By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,028 Members | 1,945 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,028 IT Pros & Developers. It's quick & easy.

how do I prevent a new record when tabbing through fields?

P: 6
MSAccess 2003:

Users tab through the data entry fields on a form, and accidently tab to the next record thereby erroneously inserting a record. What can I code in the Form_BeforeInsert to prevent the insert from happening?

Private Sub Form_BeforeInsert()

If MsgBox("Do you want to save the new BSR record " & Me.BSR_ID & " and all associated offers and price plan?", vbYesNo) = vbNo Then

'What can I code here to prevent the insert? Note, when an insert occurs, Child table records are also inserted.
End If
End Sub
Jun 26 '07 #1
Share this Question
Share on Google+
3 Replies

Expert 2.5K+
P: 3,532
No code is needed for this. In Design View for your form goto
Properties -- Other and set the Cycle Property to Current Record.
Jun 26 '07 #2

P: 6
Thank you! Thank you! It's the simple things I don't know about that trip me up.
Works like a charm, much appreciated.
Jun 26 '07 #3

Expert 2.5K+
P: 3,532
And Access has hundreds if not thousands of those "simple" things! ;0)>
Jun 26 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.