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

Faulty Autoincrement

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

    Faulty Autoincrement

    I have a problem, for which I am not finding any solution. I have parent table which has vital data of patients with first field as "patient ID" which I have set to have default value of "0001" and other 5 tables which are child ones with 1-1 relationship and they are all linked to the parent table via "patient ID".
    Now when i open the form based on this set or the default browse, the ID enters itself as 0001, the moment I tab to the next field, the ID becomes, 000.

    Where am I go wrong? I've checked and rechecked the field rules and can't seem to find the answer.
    Sincerely,
    Dr Alok Modi MD

    #2
    RE: Faulty Autoincrement

    My guess is that you need to take a look at your existing records. It may be that your current records go from "001" to "999" and the auto-increment is limited because the next value after "999" is "000" when dealing with auto-increment fields.

    Remember that the default value for an auto-inc. field is only used to set the value for first record when starting from an empty table. After that it uses the existing data.

    You may need to run a global update to all some leading zeroes to existing data.
    ID = padl(ID,5,"0")

    Cal Locklin
    www.aimsdc.net

    Comment


      #3
      RE: Faulty Autoincrement

      does it happen when you use the default form? Have you defined a field rule for the child tables or only for the parent (which is what you should have done)?

      Bill
      Bill Hanigsberg

      Comment


        #4
        RE: Faulty Autoincrement

        Oops! "to all some leading..." should have been "to add some leading..."

        Comment


          #5
          RE: Faulty Autoincrement

          I like Cal's hypothesis.
          Bill
          Bill Hanigsberg

          Comment


            #6
            RE: Faulty Autoincrement

            Yes it happens on the default form also and also on the default browse. And Cal, at present I have not entered any data so far,it is an application that I have to use for entering data yet. I have yet to make labels and reports, but I am stuck here. And I have filled up these field rules for both child and parent tables.

            Dr Alok Modi MD

            Comment


              #7
              RE: Faulty Autoincrement

              Doc,

              Please make sure that your character size (width) for the Patient_ID is set to "4" if you want to use "0001" as you auto-increment value.

              Alternatively, you can also check to see (on your form) the properties on the field object of the "patient_id" if in the "Display" tab the display format as the correct "width" set (in your case it would be "4").

              Comment


                #8
                RE: Faulty Autoincrement

                Nope same problem. The display tab is set to 6 now, it was set to 4 previously. I have a sinking feeling that I will have to redesign the whole thing from scratch.
                Dr Alok Modi MD

                Comment


                  #9
                  RE: Faulty Autoincrement

                  I suggest you enter at least one patient record using your custom data entry form. Then check the same record using the default form for the primary table in your set of tables.

                  Tell us what you see on both the custom data entry form and on the default form.

                  -- tom

                  Comment


                    #10
                    RE: Faulty Autoincrement

                    Dr

                    Cal has it right. This problem has come up a few times before.

                    The value of 000 says that the highest value in the field is 999. The increment option adds 1 to the highest value in the field rather than the last value entered.

                    The usual fix is to right justify the data in the field.
                    I'd add an alltrim to the formula that Cal suggested.

                    In this case 5 is the size of the field. Adjust as needed for the actual size of our field.

                    padl(alltrim(ID),5,"0")


                    If you are still having problems, post a copy of the talbe so we can take a look at it.
                    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.
                    "Make it as simple as possible, but not simpler."
                    Albert Einstein

                    http://www.iadn.com/images/media/iadn_member.png

                    Comment


                      #11
                      RE: Faulty Autoincrement

                      You may want to check out this thread.

                      http://msgboard.alphasoftware.com/alphaphorum/read.php3?sortby=lastreply&direction=desc&num=11&id=59382&thread=59344#MSG59405

                      Actually, this was a bug in the A5V6 beta, but has not been confirmed in A5V5.

                      Jerry

                      Comment


                        #12
                        RE: Faulty Autoincrement

                        I give up. Nothing works. Not even the padl and alltrim functions. Its 2.34 AM here in India and I am all wooly. Just returned from the hospital. I guess either its upload my database or back to the design board. I have gone through Dr Wayne's solution on the thread posted, it did not work for me. I feel it is a bug in A5. It always is 0000 in the first record and 0001 and so on in the second records and so on.In the default from, browse and my created colorful form also.And I have not entered any data s yet. How can I when I have not completed my application? so It can't be that A5 is switching over to 0000 after the 9999 records.

                        Yawwwwn!!!
                        See u guys tomorrow.
                        Dr Alok Modi MD

                        Comment


                          #13
                          RE: Faulty Autoincrement

                          Dr

                          When you get up, restore the attached database and see if the set "vitals_link" works. There are currently no records in either table and no forms. Open the default form for the set or the default browse for the parent table "vitals". In both cases, autoincrement works correctly for me.

                          One of the keys is that an autoincrement field should be set to skip as it should not be a field a user can enter. Also, you must set the default value in field rules at the start of entry, or you will see the results you are seeing where the field appears to go to "0000". When the record is saved in that condition, the correct initial value should enter, but it looks very odd when you are entering.

                          If this doesn't work, then there is something indeed odd.

                          Jerry

                          Comment


                            #14
                            RE: Faulty Autoincrement

                            Hi Jerry
                            Firstly let me tell you that alpha five is a wonderful software because it is "run" by people like all of you sweet souls on this message board, who take the time, initiative and pains to help lost souls like us. Yes I ran your sample application and it works fine. So there is no bug on my version, but somewhere my design is faulty. So let me try and see if I can correct that.
                            Will get back to you.
                            Regards
                            Dr Alok Modi MD

                            Comment


                              #15
                              RE: Faulty Autoincrement

                              Found his problem. The field width on the parent table was set at 3. This may have been a typo because the child tables were set at 4.

                              Comment

                              Working...
                              X