Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Preventing spaces in a Browse Field.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Preventing spaces in a Browse Field.

    I've looked everywhere, and tried Remspecial etc. The trouble is that the Remspecial On Depart doesn't work in the Browse where the data is being entered. The Field Value is not changed.
    I need to prevent a user entering spaces. The Text must be contiguous.
    10 char mask is A&&&&&&&&& at present.

    I've had to add a calculated field based on Remspecial and this works fine, but it would be better to prevent the spaces in the first place.
    Anyone got any code/ideas to help with this?
    See our Hybrid Option here;
    https://hybridapps.example-software.com/


    Apologies to anyone I haven't managed to upset yet.
    You are held in a queue and I will get to you soon.

    #2
    Re: Preventing spaces in a Browse Field.

    Try coding the cansaverecord event in field rules.

    tbl = table.current()
    tbl.fieldname = remspecial(tbl.fieldname)

    If the browse is of a child table in a set you would need to

    tbl = table.current(#)

    changing # to the position of the table in the set.
    Last edited by Stan Mathews; 08-26-2011, 08:45 AM.
    There can be only one.

    Comment


      #3
      Re: Preventing spaces in a Browse Field.

      My turn to cook tonight so I'll try it first thing tomorrow Stan.
      Have you been affected by the hurricane?
      Looks grim on the UK news!
      See our Hybrid Option here;
      https://hybridapps.example-software.com/


      Apologies to anyone I haven't managed to upset yet.
      You are held in a queue and I will get to you soon.

      Comment


        #4
        Re: Preventing spaces in a Browse Field.

        Far inland from that mess and we're under the high pressure area which is keeping Irene east.

        Don't think I mentioned that the code I suggested will allow spaces in the data entry but remove them when the record is saved.
        There can be only one.

        Comment


          #5
          Re: Preventing spaces in a Browse Field.

          Originally posted by Stan Mathews View Post
          Try coding the cansaverecord event in field rules.

          tbl = table.current()
          tbl.fieldname = remspecial(tbl.fieldname)

          If the browse is of a child table in a set you would need to

          tbl = table.current(#)

          changing # to the position of the table in the set.
          Stan, I am pretty sure that in an event defined in the field rules of a table table.current() always refers to that table. Even if that table is being used in a set at some time.

          Originally posted by Stan Mathews View Post
          Far inland from that mess and we're under the high pressure area which is keeping Irene east.

          Don't think I mentioned that the code I suggested will allow spaces in the data entry but remove them when the record is saved.
          I was thinking of using a_field_value.value = rtrim(a_field_value.value," ") in the canWriteField field event but that has the same issue. The spaces are not removed till after the field is departed. So only the last character would be checked. So a_field_value.value = strtran(a_field_value.value," ","") might have to do.



          Unfortunateley in the event model of both the database engine and forms the change event does not fire till after leaving the field. Contrast this with teh change event in an input control in xdialog.

          My next idea is to set up an OnKey event which checks for the current object and if the key is a space ignores it. But OnKey is not available for Browses defined in the browse tab.

          Ted,
          You referred to data entry in a browse. Could you clarify if this a Browse browse or an embedded browse.
          Tim Kiebert
          Eagle Creek Citrus
          A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

          Comment


            #6
            Re: Preventing spaces in a Browse Field.

            Someone asked this same question a while back.
            In the CanWriteField event (In Field Rules), put this script:
            a_field_value=remspecial(a_field_value)

            Comment


              #7
              Re: Preventing spaces in a Browse Field.

              Originally posted by G Gabriel View Post
              Someone asked this same question a while back.
              In the CanWriteField event (In Field Rules), put this script:
              a_field_value=remspecial(a_field_value)
              As mentioned in post 5 that event only fires when leaving the field. I believe Ted is looking to prevent the space during entry in the field.
              Tim Kiebert
              Eagle Creek Citrus
              A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

              Comment


                #8
                Re: Preventing spaces in a Browse Field.

                Tim, it's an Embedded Browse.
                I've done it this way for a reason - so people can see the Fields.
                Please see attached. First Menu Form button - first Browse is Table Name, second Browse is Fields. You will see the problem.
                GG has an earlier copy already and has assisted previously with a diferent prob.

                Stan, good to know you aren't affected. Hope the rest of the US gets off lightly.
                We don't get the same sort of weather in the UK, although we had an earthquake about 15 miles from me and severe flooding the next year, but on the Fens, there are many deep drainage ditches so we were OK.
                Attached Files
                See our Hybrid Option here;
                https://hybridapps.example-software.com/


                Apologies to anyone I haven't managed to upset yet.
                You are held in a queue and I will get to you soon.

                Comment


                  #9
                  Re: Preventing spaces in a Browse Field.

                  Originally posted by Tim Kiebert View Post
                  As mentioned in post 5 that event only fires when leaving the field. I believe Ted is looking to prevent the space during entry in the field.
                  Really?
                  Originally posted by Ted Giles View Post
                  The trouble is that the Remspecial On Depart doesn't work in the Browse
                  Browses..stand-alone browses, don't have an onKey event at least not in my version.

                  Comment


                    #10
                    Re: Preventing spaces in a Browse Field.

                    Hi Ted,
                    Why the password on the form?
                    Robin

                    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

                    Comment


                      #11
                      Re: Preventing spaces in a Browse Field.

                      It's a development version Robin.
                      Would it help if I sent one without the password?
                      I had thought of having some code to display a "no spaces allowed",
                      but that would mean going back and correcting.
                      Another thought was to have the Remspecial field conditionally displayed with a reason explaining the difference if a space was removed.
                      The underlying rationale is that spaces are not valid in Field Names.
                      Last edited by Ted Giles; 08-27-2011, 03:42 PM.
                      See our Hybrid Option here;
                      https://hybridapps.example-software.com/


                      Apologies to anyone I haven't managed to upset yet.
                      You are held in a queue and I will get to you soon.

                      Comment


                        #12
                        Re: Preventing spaces in a Browse Field.

                        Oops!
                        Dupe.
                        Last edited by Ted Giles; 08-28-2011, 04:22 AM.
                        See our Hybrid Option here;
                        https://hybridapps.example-software.com/


                        Apologies to anyone I haven't managed to upset yet.
                        You are held in a queue and I will get to you soon.

                        Comment


                          #13
                          Re: Preventing spaces in a Browse Field.

                          I hate to say it, but if you were doing data entry in xdialogs, this would be a done deal, simple, no brainer, case closed, fini. Open the Port and start happy hour.
                          Mike W
                          __________________________
                          "I rebel in at least small things to express to the world that I have not completely surrendered"

                          Comment


                            #14
                            Re: Preventing spaces in a Browse Field.

                            So Mike, how easy is it to create an xdaialog which looks like a Browse, showing a table of records and content like a Browse does?
                            P.S.
                            Don't need any excuses to open the Port, but I make Home Brew and have 15 gallons on tap at any one time!
                            See our Hybrid Option here;
                            https://hybridapps.example-software.com/


                            Apologies to anyone I haven't managed to upset yet.
                            You are held in a queue and I will get to you soon.

                            Comment


                              #15
                              Re: Preventing spaces in a Browse Field.

                              Originally posted by G Gabriel View Post
                              In the CanWriteField event (In Field Rules), put this script:
                              a_field_value=remspecial(a_field_value)
                              I went this route as the table in the set is 3 levels deep. Just one thing to be wary of if anyone else does this, you have to delete and recreate the Browse in the Form otherwise the data can be entered but will not display properly afterwards. Seems like the record doesn't recognise the field content ( I used the Required flag ) if you just rely on the Field Rules.

                              I'll wait for some feedback on this way of data presentation.

                              Thanks for the help and support.
                              See our Hybrid Option here;
                              https://hybridapps.example-software.com/


                              Apologies to anyone I haven't managed to upset yet.
                              You are held in a queue and I will get to you soon.

                              Comment

                              Working...
                              X