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

"Next record" form navigation button annoyance

  • Filter
  • Time
  • Show
Clear All
new posts

  • "Next record" form navigation button annoyance

    I have a "go to next record" button on a form that has been created from the A5 "Next record" pre-defined buttons list - see attached screen shot.

    The intention of this button is to browse through table records on my form, advancing one record every time the button is clicked.

    The problem I have is that when I get to the last record in the table, clicking on the button adds a new record to the table and saves it! And furthermore clicking again adds another record and so on, ad infinitum.

    This is not acceptable behaviour in my application. I have an "add new record" button to add new records.

    To stop this rogue behaviour I have tried to enforce form property restrictions, e.g. for "enter new records". This works but it also stops the "add new record" button working too. So this is not a workable solution.

    Does anyone have a better solution to this problem to stop the "next record" button adding new records to my table.

  • #2

    In the form's property dialog, form tab, in the restrictions list box -- scroll down and there is an item called 'Continuous enters'. Help describes this as "The user's ability to continuously enter new records." The equivalent property name is .Restrict_continuous_enters = .T.

    You could also do this on your add new record button.
    'some code
    :YourFormName.Restrict_enter = .F.
    'the record adding code
    :YourFormName.Restrict_enter =.T.
    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.


    • #3
      Thanks, Tim. But none of your two suggestions seemed to make any difference. Blank records still get added to the table.


      • #4
        Originally posted by Tim Kiebert
        You could also do this on your add new record button...
        It would be fair to say this annoyance that I describe in my opening post is just that. I have found a solution but .... at some cost. :mad:

        Here is what I mean.

        If I create a "go to next record" button on my form using the "Next" pre-defined A5 button, it inserts the following Xbasic code:

        Now I change this code as follows (as per Tim's suggestion):

        :MyFormName.Restrict_enter = .T.
        :MyFormName.Restrict_enter = .F.
        And what happens when I now click on my "Next" pre-defined button? Well, I still have the same problem. Once I get to the last record displayed on my form and press "Next" I get a blank record added to my table, and If I click again - another blank record, and so on ad infinitum.

        So now I decide (divine inspiration perhaps?) to change the Xbasic code as follows:

        :MyFormName.Restrict_enter = .T.
        :MyFormName.Restrict_enter = .F.
        And what happens when I press my "Next" button. Well it now works properly - the record displayed stops at the last record and will not add spurious extra blank records every time I click on the "Next" button.

        Well hallelujah! :confused:


        • #5
          Hi Brett,

          I was just trying it in Alphasports in v7 and v6 as well and confirm the behaviour as you describe. Unless I/we are missing something I would say things are not behaving as advertised. (I can hear you all the way across the Tasman saying, "Thats bloody obvious").

          As far as the attempts that you describe, they weren't really what I had in mind. I should have been more clear. I meant that you should try leaving the next record button as originally defined (topparent.command("RECORD_NEXT") ), set the form to restrict_enters and then use the :MyFormName.Restrict_enter = code in the button or code you use to enter a new record. ie set Restrict_enters to false--add the newrecord--tehn set Restrict_enters to true. The resulting behaviour I had intended was to have the form be in restrict_enter as default and only allow an enter when you say so.

          The wierd thing is I have just tried changing the predefined button to .fetch_next() as you did and I still get new records even though Restrict_Continous_Enters is checked.:confused: In either case if I set Restrict_Enters to true then I don't get new records.

          I'm glad you got yours working. Just keep an eye on it. It may still sneak up on you.
          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.


          • #6
            This situation is normal if your form (or entire database) is set to modeless entry. It will not do that if you set it to modal. Not sure what effect that will have on the rest of your design for that form (or entire database) though. Alternatively, you can set the restrictions to not allow "enter record".

            The modal versus modeless entry design deserves a lot of thought when you design your application. It needs to be discussed with your users. There are advantages to both. At least Alpha gives you the option, and form by form at that.

            Bill Belanger
            Last edited by; 01-30-2006, 04:04 AM.


            • #7

              Your button is behaving exactly like the form navigation tools on the default form's toolbar. In my testing here the new record is not automatically saved, it's just started. The user can still cancel if the new record was begun inadvertantly. However, if they push the same navigation button again, instead of cancelling, the first partially completed record will be saved. Unless my memory is playing tricks with me this behavior is the same in the default form for the table.

              Another idea for changing this behavior: You can use the properties of the form to 'restrict enters' and 'restrict continuous enters'. This will prevent the new record from beginning automatically. When you want the user to be able to enter a new record arrange for your "new record" button to remove these restrictions just before beginning the new record. Your "save record" button can put the restrictions back in place.

              -- tom


              • #8
                Thanks for the help provided by everyone here.

                I used the solution in my previous message as suggested by Tim and applied it to about a dozen modeless forms in my application. It appears to be working OK. I had no idea something so simple could be so difficult, but now I know and will use the same technique in future.

                I would like to see A5 cope a little more intelligently with this requirement (to stop a "get next record" adding spurious blank new records to the end of a table). There may be a technical reason why it should do this but even so it fails the common sense test (is it common sense for A5 to do this? Clearly not). If it caused me some prolonged aggro I am sure it will do the same to others too.


                • #9
                  although this will not prevent the behavior you mention, this will help prevent accidentally saving "blank" records, silently, which is especially helpful in embedded browses.

                  in field rules for the table, in events, in record events, put:

                  if a_deleting_record 'don't fire on delete
                  end if

                  if t.lastname="" .or. t.firstrname="" 'the name of a critcal field or fields
                  end if
                  Cole Custom Programming - Terrell, Texas
                  972 524 8714

                  "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw


                  • #10
                    I would like to see A5 cope a little more intelligently with this requirement (to stop a "get next record" adding spurious blank new records to the end of a table).
                    Brett, I'd like to see the keystroke sequence you follow for this to happen. In my testing here the get next record action script begins a new record, but does not commit it. Nothing is "added" to the table until the user navigates off the pending new record or saves it on purpose. Am I missing something?

                    -- tom


                    • #11
                      Tom, the keystroke sequence was simply to go to the last record in a table and then click on the "Next record" button which has the Xbasic code behind it:
                      With no field editing rules violated, A5 just keeps appending new blank records to the end of my table every time the button is clicked. It should be easy enough to duplicate. It was for me.

                      I have run into this problem in previous applications and had to add in some code to detect when the last record is reached and then ignore subsequent "next record" requests. It works OK but I am getting tired of having to do this. I found Tim's suggestion a lot easier and quicker. Even better is if the problem in A5 can be fixed.


                      • #12
                        Brett, thanks.

                        Your sequence is what I'm seeing here. A small point that I think is worth noting is that it's your second button push that saves the first blank record. The first button push begins the new record but does not commit it. The ESC key will cancel the enter, as will the "Cancel Changes" icon on the toolbar. But they have to be pushed before the "Next Record" button is pushed a second time.

                        This behavior is the same that the user would see if they navigated to the last record in the table and began a new record manually. Or, if they navigate to the last record in the table and press the PgDn key.

                        -- tom
                        Last edited by Tom Cone Jr; 01-31-2006, 07:14 AM.


                        • #13
                          Tom, yes my observation also. It would be nice if the good folk at Alpha Software could fix this problem. It's been around for a while now and us oldees have grown accustomed to it. It will not impress newbees to A5 though.


                          • #14

                            In the for what it is worth department (FWIW), it is exactly the same characteristics as Acc..s has. And since I don't have any other competitive products loaded, I can only guess as their behavior.

                            So I'm not as sure that newbies will find it so painful. Especially if they come from an Acc..s background.

                            On the other hand, I can argue both sides of this issue, because at times I'd really like to choose how I want the behavior to be. But then that gets more complicated too.... So then where did the simple tool go?

                            Personally I'd love to have my cake and eat it too....
                            Al Buchholz
                            Bookwood Systems, LTD
                            Weekly QReportBuilder Webinars Thursday 1 pm CST

                            Occam's Razor - KISS
                            Normalize till it hurts - De-normalize till it works.
                            Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
                            When we triage a problem it is much easier to read sample systems than to read a mind.


                            • #15

                              Yes, you are right too! But IMHO when used on a form the "next record" button should *not* behave in this manner. Here is some more of my FWIWs.

                              When used on a *form*, the following buttons are for *navigation*:

                              first record
                              last record
                              next record
                              previous record
                              find record

                              When used on a form the following buttons are for *altering* record details:


                              On my form designs I keep the navigation and altering buttons separate to make the application more intuitive for the user. I certainly don't expect (nor would my users) the navigation button that normally advances to the next record to start adding new records to the end of the table. This is, IMHO, silly.

                              An analogy. The "previous record" button does not suddenly start adding records to the start of a table once I advance to the first record in my table. If it did this would be silly too.

                              So my argument is that a navigation button on a form should never, ever, start adding spurious records to the end of a table.

                              The problem as I see it could be readily fixed. This is the code generated by the A5 "Next record" pre-defined buttons list is currently this:

                              The code I would like to see it replaced by is this:

                              :MyFormName.Restrict_enter = .T.
                              :MyFormName.Restrict_enter = .F.
                              Simple, the problem and the solution all here together in one place. No copyright, anyone is free to use my idea. :)

                              PS: Maybe just one improvement to my code would be to first save the current status of the Restrict_enter setting, then set it to .T. and do the fetch_next. And finally restore the Restrict_enter setting. E.g.

                              Dim lCurrSetting as L
                              lCurrSetting = :MyFormName.Restrict_enter	' If this syntax is correct?
                              :MyFormName.Restrict_enter = .T.
                              :MyFormName.Restrict_enter = lCurrSetting