Add New Record adds a new records, though not clicked

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rakeshshail2010
    New Member
    • Jun 2010
    • 1

    Add New Record adds a new records, though not clicked

    Dear sir,

    I have designed one data entry form and placed one command button that adds (save) entries from fields on the form to table records when clicked. However, I have noticed if I just bypass the command button by pressing tab (not a click), it adds the values of the fields to the respective table. I tried to set AllowAdditions= FALSE after form is loaded and new record is added but it just makes all my control invisible. What should I do ? I want if someone keeps pressing tab after feeding the values in the text boxes and combo boxes it should not add them to table until the command buttong is pressed.

    Thanks & Regard,
  • missinglinq
    Recognized Expert Specialist
    • Nov 2006
    • 3533

    #2
    My guess is that your AddNew command button is not "adding a record without being clicked!"

    Access, by default, saves a record when you move to another record, whether it be a new record or an existing record. It also saves the current record if you close the form.

    What is happening when you hit the <Tab> key is that you're are being moved to a new record. This is the default behavior. To change this, in Form Design View, goto Properties - Other and change the Cycle Property from All Records to Current Record. Now when you get to the last control on your form and hit <Tab> the cursor will cycle back to the top of the current form, not go to a new record.

    If you want to prevent Access from automatically saving a record when moving to a different record or closing the form, you'll have to put code in the Form_BeforeUpda te event asking the user to save or dump the record.

    Welcome to Bytes!

    Linq ;0)>

    Comment

    Working...