Access data entry problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • arali
    New Member
    • Jan 2008
    • 24

    Access data entry problem

    I am using Access
    I made a Database in which i define a field in table id as Auto increment field.
    I im using switchboard manager to open the form in dataentry mode.
    When i open form and just type some thing in other field not save it and close the form with out saving .
    When i open again the form the Auto increment field is incremented.and there is no other data in other fields they are blanck.
    Even when i Navigate through other fields and close it when i again open it the field is incremented .how to over come this problem.
    Regards
    << ARALI >.
  • mshmyob
    Recognized Expert Contributor
    • Jan 2008
    • 903

    #2
    Is your auto increment field bound to your table and your other fields unbound?


    Originally posted by arali
    I am using Access
    I made a Database in which i define a field in table id as Auto increment field.
    I im using switchboard manager to open the form in dataentry mode.
    When i open form and just type some thing in other field not save it and close the form with out saving .
    When i open again the form the Auto increment field is incremented.and there is no other data in other fields they are blanck.
    Even when i Navigate through other fields and close it when i again open it the field is incremented .how to over come this problem.
    Regards
    << ARALI >.

    Comment

    • missinglinq
      Recognized Expert Specialist
      • Nov 2006
      • 3533

      #3
      Originally posted by arali
      When i open again the form the Auto increment field is incremented.and there is no other data in other fields they are blanck.
      When you open a form in DataEntry mode the fields will always be blank! DataEntry mode only allows new records to be entered/viewed. The autoincremented field has a value because you've set this up to happen when a new record is created.
      Originally posted by arali
      When i open form and just type some thing in other field not save it and close the form with out saving .
      In Access, when you enter data in a record and then move to another record or close the form, the default behavior is to save the record, which is what is happening here. If you open your underlying table, you should see a record for each autoincrementin g number you've created.

      To prevent this from happening, you need to place code in the Form_BeforeUpda te event, asking the user if they want to save the record. If they respond Yes, you do nothing and the record is saved. If they respond No, you use Cancel = True which dumps the entered data.

      Linq ;0)>

      Comment

      • mshmyob
        Recognized Expert Contributor
        • Jan 2008
        • 903

        #4
        That is true Linq but according to his description he is opening the form for data entry and has a Autonumber field. As you say it will automatically generate a record and put a value in that field but then he also says that he enters data into other fields on his form and closes it 'without' saving and when he reopens it he has the new record with the autonumber filled in but no other data.

        It sounds to me like his text boxes on his form are not bound to the table and that is why no data appears in the record other than the auto number field.

        You think that might be what is happening? I am still waiting for his reply.

        Originally posted by missinglinq
        When you open a form in DataEntry mode the fields will always be blank! DataEntry mode only allows new records to be entered/viewed. The autoincremented field has a value because you've set this up to happen when a new record is created.

        In Access, when you enter data in a record and then move to another record or close the form, the default behavior is to save the record, which is what is happening here. If you open your underlying table, you should see a record for each autoincrementin g number you've created.

        To prevent this from happening, you need to place code in the Form_BeforeUpda te event, asking the user if they want to save the record. If they respond Yes, you do nothing and the record is saved. If they respond No, you use Cancel = True which dumps the entered data.

        Linq ;0)>

        Comment

        • missinglinq
          Recognized Expert Specialist
          • Nov 2006
          • 3533

          #5
          No, there is nothing in this post to suggest that his fields are unbound! If his post is accurate, that is not what is happening! He didn't say he was opening the form for data entry, he said

          "I im using switchboard manager to open the form in dataentry mode."

          As I explained before, when a form is opened in dataentry mode it opens to a new record. In dataentry mode you can only add new records, you cannot view existing records! The data he is entering is, I am sure, being saved to the underlying table; this is evidenced by the fact that the auto-incremented number keeps increasing.

          He also made no mention of an Autonumber, he said auto incremented number. These are two entirely different things. An Autonumber is created by Access, and really should never be seen/used by the end user ; it should only be used by Access for internal housekeeping. An auto incremented number, on the other hand, is generated thru custom VBA code, and can be used for such things as generating ID numbers, account numbers, etc.

          Linq ;0)>

          Comment

          • mshmyob
            Recognized Expert Contributor
            • Jan 2008
            • 903

            #6
            Yes of course. Now I understand. He is constantly opening a new record, he is not reviewing his previous records.

            Thanks for clearing that up for me.

            Originally posted by missinglinq
            No, there is nothing in this post to suggest that his fields are unbound! If his post is accurate, that is not what is happening! He didn't say he was opening the form for data entry, he said

            "I im using switchboard manager to open the form in dataentry mode."

            As I explained before, when a form is opened in dataentry mode it opens to a new record. In dataentry mode you can only add new records, you cannot view existing records! The data he is entering is, I am sure, being saved to the underlying table; this is evidenced by the fact that the auto-incremented number keeps increasing.

            He also made no mention of an Autonumber, he said auto incremented number. These are two entirely different things. An Autonumber is created by Access, and really should never be seen/used by the end user ; it should only be used by Access for internal housekeeping. An auto incremented number, on the other hand, is generated thru custom VBA code, and can be used for such things as generating ID numbers, account numbers, etc.

            Linq ;0)>

            Comment

            • missinglinq
              Recognized Expert Specialist
              • Nov 2006
              • 3533

              #7
              It would appear that this is what's happening, from the information given in the original post. It would be unlikely (although, of course, not totally impossible) that the auto-incrementing field was bound but the other controls were unbound. Unbound controls generally have one of two purposes. They're either used to hold calculations, in which case you don't manually enter data in them, as the OP stated he does here, or they're used to enter criteria for something such as a search or for a query, in which case you don't expect to see the data in the control the next time you visit the record.


              Linq ;0)>

              Comment

              Working...