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

Link & auto increment question

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

  • Link & auto increment question

    I have two tables. Parent & child. In the parent table the link is set as auto increment. No default set. The auto increment starts at zero when entering records. When every the the first record is entered (on a browse, with the child present) it bumps down one and leaves a blank record above it when entering the first record. It adds the first record (one with the zero)
    If I override the 0 in the table (set it to 1) and switch to the form no problem. Very irritating. Tried rebuilding indexes and compacting. What is going on. ? There is no code of any kind involved yet.

  • #2
    Re: Link & auto increment question

    Hi James,

    Here is one of the best known secrets of how to develop with Alpha 5.

    http://www.learn alpha.com/BarrysTools/BarrysTools.htm

    Have a good look at the other articles.

    Also, two things to remember.
    (1) Make the autoincrement field Character
    (2) Set the default value to "000001" assuming the field length is 6.
    Regards
    Keith Hubert
    Alpha Guild Member
    London.
    KHDB Management Systems
    Skype = keith.hubert


    For your day-to-day Needs, you Need an Alpha Database!

    Comment


    • #3
      Re: Link & auto increment question

      Keith

      Appreciate the reply. Two things;
      Changing to character did not correct the issue.
      Why should it a have to be character. ? Is this the intended effect if the field is numeric. ?

      Comment


      • #4
        Re: Link & auto increment question

        Hi James,

        How about if you cut down and zip up your app?

        Post it here, then we can look at exactly what you are trying to do.
        Regards
        Keith Hubert
        Alpha Guild Member
        London.
        KHDB Management Systems
        Skype = keith.hubert


        For your day-to-day Needs, you Need an Alpha Database!

        Comment


        • #5
          Re: Link & auto increment question

          Keith;

          Thanks for the interest.
          I've attached two tables. Names changed and fields removed, but they do the same thing. They are linked. The master having the link as a auto increment.
          Make sure both tables are empty. Go to the form view and enter data on the first record of the master. (Will be the left most table on the form view.) On departing it will insert a blank record.
          Let me know if you see the same thing.
          Thanks again.

          Comment


          • #6
            Re: Link & auto increment question

            Attached

            Comment


            • #7
              Re: Link & auto increment question

              I'm not sure the "reason" for this blank line, i think because it is autoincrement, is needing a first line to "start" ... but all you have to do is set the simple default to 0 in field rules... and it works just fine.. this way it gives it somewhere to start.

              Comment


              • #8
                Re: Link & auto increment question

                Programsurplus (Isthatyourrealname?)


                That screwy behavior is not supposed to be there. I tried several other tables (setups that had been designed awhile back) Same set up, no problem. Now regardless of where I construct the set up the same thing occurs. What's going on. ? Anyone else have any input on this. ?

                Comment


                • #9
                  Re: Link & auto increment question

                  Hi James,

                  I made the changes I suggested and now there is no blank record to start with.

                  The autoincrement fills the first field but the curser is at Name waiting for input. If you close the form without saving then nothing is saved.

                  Did you take into account the Tab order?

                  See attached.
                  Regards
                  Keith Hubert
                  Alpha Guild Member
                  London.
                  KHDB Management Systems
                  Skype = keith.hubert


                  For your day-to-day Needs, you Need an Alpha Database!

                  Comment


                  • #10
                    Re: Link & auto increment question

                    I think the problem is related to there only being one column in the browse. This has been mentioned before I think.
                    Using the default browse does not create new records.

                    Even in Keith's sample, although the browse is for the child table you can keep clicking on the new record row and records get added which is normally not the case if nothing has been entered into the record.

                    I think the work around was (and after trying seems to fix the problem) to added a second column to the browse and set its width to 0 to 'hide' it.

                    Oh and
                    Originally posted by milesjg View Post
                    Programsurplus (Isthatyourrealname?)
                    if you look closely that is not even her forum name. One clue could be that under her forum name is an item Real name: Lynda Huddleston;)
                    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


                    • #11
                      Re: Link & auto increment question

                      Hi Tim,

                      James problem was
                      On departing it will insert a blank record
                      I assume he meant in the child table. That was because he entered into the browse, new child record was automatically created.

                      Yes if you click new record in the child browse it will add a new record. Adding a dummy hidden column does prevent that, neat trick. I've leaned something new today. Thanks.
                      Regards
                      Keith Hubert
                      Alpha Guild Member
                      London.
                      KHDB Management Systems
                      Skype = keith.hubert


                      For your day-to-day Needs, you Need an Alpha Database!

                      Comment


                      • #12
                        Re: Link & auto increment question

                        One of James questions hasn't, as yet, been answered.
                        Keith:
                        (1) Make the autoincrement field Character

                        James:
                        Why should it a have to be character. ?
                        From a post back in June from Steve Wood:
                        ....one word of caution, its much better if you use a character field for autoincrement than numeric. It will save you lots of headaches later on.
                        I've wondered the same thing and would like to have an answer before I get too far down the road using numerics for auto-incremented fields.

                        Thanks.
                        Ernie

                        Comment


                        • #13
                          Re: Link & auto increment question

                          Keith, Tim, endstorms and personwiththestrangename

                          I see I was not specific at first. On the first row of the master table. With or without the child table on the form. If data is entered and the down arrow is pressed a blank record appears above the row with the data entered in it. Like a new record was inserted.
                          Also I took the tables changed the link fields to C and it does the same thing.
                          It is also doing the same thing regardless if there is a default value set.
                          I added another field to the table and it does the same thing. I rebuilt the indexes and compacted. Still the same. If I move to another directory and create a table, linked or not, one field or many, I get the same thing as long as the first field (have not tried it on any others) is auto increment this happens.
                          Created a table in another directory (attached) same thing. As long as the auto increment field is there. Even tired it with placing the auto increment field along with two others in the browse. (No links.) Attached three setups. Very plain. I think I may have something wrong with my Alpha if this cannot be duplicated. Suerly this cannot be intended. ?

                          Comment


                          • #14
                            Re: Link & auto increment question

                            Once again attached

                            Comment


                            • #15
                              Re: Link & auto increment question

                              Hi Ernie,

                              To try and answer the question as to why it is better to have a character field for the autoincrement?

                              I know that it makes it easier to have numeric fields for autoincrement but over the years I have taken the advice of more experienced developers.

                              When a field is used as a link to a child table, Alpha creates an Index. My understanding is that this index could get confused if the field is numeric. I believe that if it is numeric, Alpha converts it to character as it builds the index. But only in the Index file. This make an for un-necessary overhead.

                              So the recommendation is to make fields that are not going to be used in calculations character.
                              Regards
                              Keith Hubert
                              Alpha Guild Member
                              London.
                              KHDB Management Systems
                              Skype = keith.hubert


                              For your day-to-day Needs, you Need an Alpha Database!

                              Comment

                              Working...
                              X