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

How to prevent changes to a id field

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

    How to prevent changes to a id field

    I have a form that I use for data entry that has an id field as a drop down box. (lookup to a customer table and automatically fills fields in the data entry form)

    I would like to make a copy of this form and use it to edit data after the original entry has been done.

    I would like to prevent the user from changing the ID field during the edit. I would like for the user to be able to hit the drop down arrow, edit the customer info in the customer table, and save. This info would then be changed in the data edit form as normal.

    I am aware of changing form porperties to uncheck the tab stop or to make it read only, but these methods will not allow the user to hit the drop down arrow.

    I assume what I need is an event on the form that prevents the id field from changing. This is where I need help

    Thanks
    Tony

    #2
    Re: How to prevent changes to a id field

    I would try place the lookup object inside a conditional object on the form to be present only when the value is blank
    Ensure when opening the form and saving a result to clear the value.

    Comment


      #3
      Re: How to prevent changes to a id field

      Ray
      Thanks for the reply.
      If I understand you correctly, this would not work for me because I need the ID field to be visable and useable on both the entry form and the edit form. However, I want to prevent the user from changing the ID field value during a edit, but I want them to be able to drill down and make changes to the customer table that when saved makes those same changes to the parent form.
      Thanks
      Tony
      Tony

      Comment


        #4
        Re: How to prevent changes to a id field

        Originally posted by twwtc View Post
        Ray
        Thanks for the reply.
        If I understand you correctly, this would not work for me because I need the ID field to be visable and useable on both the entry form and the edit form. However, I want to prevent the user from changing the ID field value during a edit, but I want them to be able to drill down and make changes to the customer table that when saved makes those same changes to the parent form.
        Thanks
        Tony
        Tony
        When you say "I want to prevent the user from changing the ID field value during a edit" just what do you mean? Are you saying you want to prevent them from changing customer #2's id to customer #3's id or are you saying you want to prevent them from selecting customer #3 if they opened the form to edit customer #2 ?

        If the customer ID number is system assigned via an auto-increment field rule then they should not be able to change a customers id number in the first place.

        Comment


          #5
          Re: How to prevent changes to a id field

          Hi, Tony,

          I think you need to tell us how the ID field is populated in each new record.

          If you're using an autoincrement field rule many people would set the "skip" rule TRUE, so the user could never change an ID.

          -- tom

          Comment


            #6
            Re: How to prevent changes to a id field

            Preston

            An example of what I am doing:

            Say an invoice is entered on Friday to John Doe and then on the following Monday we learn we have the wrong address for him. I want the user to be able to open the invoice and hit the drop down arrow in the Cust_ID field (which brings up the Customer Table) edit his address, save, return to invoice (with corrected info in address fields of the invoice)

            I am trying to prevent the occasional error by the user of changing the Cust_ID to someone other than John Doe. On this form, I only want the user to be able to edit John Doe's address.

            I'm sure I am making this a lot harder than it should be, but my knowledge of xbasic is very limited.

            Hope this helps
            Tony

            Comment


              #7
              Re: How to prevent changes to a id field

              Hi, Tom
              The Cust_ID field is chosen by the user, either by lookup or if they remember it from past sales, they can enter it directly. It is not autoincrement
              Thanks
              Tony

              Comment


                #8
                Re: How to prevent changes to a id field

                Ok. If you lock the ID field after they commit the new record they can't fix an error if they "mis-remembered" the id? Not sure I'd do it that way.

                Comment


                  #9
                  Re: How to prevent changes to a id field

                  Originally posted by twwtc View Post
                  Hi, Tom
                  The Cust_ID field is chosen by the user, either by lookup or if they remember it from past sales, they can enter it directly. It is not autoincrement
                  Thanks
                  Tony

                  The cust_id should be a unique id that is system issued using an auto increment field. If for no other reason than to give your app a fool proof way to track the records for that customer.

                  If you are using prior customer numbers from before using Alpha then create a second id field and call it something like cust_number.

                  If someone else does not clarify this a little better I will try and throw up an example later today sometime. I am by no mean an expert with Alpha or Xbasic but I do have this issue nailed down as I have something similar in my app.

                  Comment


                    #10
                    Re: How to prevent changes to a id field

                    Tom,
                    That makes perfect sense, but in this one application and on this one form, I do have this odd need, if it can be done.

                    Preston,
                    My Cust_ID is unique. (my explanation has not been the best)

                    Thanks
                    Tony

                    Comment


                      #11
                      Re: How to prevent changes to a id field

                      Originally posted by twwtc View Post
                      Tom,
                      That makes perfect sense, but in this one application and on this one form, I do have this odd need, if it can be done.

                      Preston,
                      My Cust_ID is unique. (my explanation has not been the best)

                      Thanks
                      Tony
                      If you care to share a stripped down example of your app by private PM or even posted here then either myself or others could help you more. Just make a copy and put a few fake customers in it.

                      Comment


                        #12
                        Re: How to prevent changes to a id field

                        Tony, here's an idea for you.

                        Comment


                          #13
                          Re: How to prevent changes to a id field

                          Tom
                          Thanks for taking the time to put togeter the video.
                          My main problem is that I am not working within a set.
                          The invoice form is doing a simple table lookup to get cust info. If I edit info in the actual cust table, only invoices created from that point forward will show the changed cust info, unless I open a particular invoice, hit the drop down arrow in the cust_id field and then hit enter to save the changes.
                          This is where I was wanting to prevent the user from changing the cust_id field, but allow them to edit the actual cust info.
                          I know this is not a good way of doing things, but I put this small app together many years ago and I don't seem to have time to re do it
                          Thanks Tony
                          Thanks
                          Tony

                          Comment


                            #14
                            Re: How to prevent changes to a id field

                            Tom
                            Thanks for taking the time to put togeter the video.
                            My main problem is that I am not working within a set.
                            The invoice form is doing a simple table lookup to get cust info. If I edit info in the actual cust table, only invoices created from that point forward will show the changed cust info, unless I open a particular invoice, hit the drop down arrow in the cust_id field and then hit enter to save the changes.
                            This is where I was wanting to prevent the user from changing the cust_id field, but allow them to edit the actual cust info.
                            I know this is not a good way of doing things, but I put this small app together many years ago and I don't seem to have time to re do it
                            Thanks Tony
                            Thanks
                            Tony

                            Comment


                              #15
                              Re: How to prevent changes to a id field

                              Ok. My example does what you want. Only diff is I locked the company field. Just adapt what I did to your ID field in the form used to edit the actual cust info.
                              Last edited by Tom Cone Jr; 05-09-2012, 06:24 AM.

                              Comment

                              Working...
                              X