Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tab triggering BeforeUpdate event

Status
Not open for further replies.

kimsMTC

Programmer
May 30, 2007
50
US
I have a simple form with a sub-form. My form only allows additions. The sub-form displays the list of all previously added records. I have 2 buttons: "ADD TO PROJECT" and "CLOSE". There is only 1 field to enter the Project Name. My problem is stopping data from being entered without my knowing it. My tab order is: TAB 1 = PROJECT NAME; TAB 2 = "ADD TO PROJECT" button; TAB 3 = "CLOSE" button. There is no other tab order. However, once I tab from the CLOSE button, TAB 3, it triggers the BeforeUpdate event and goes ahead and adds the record without going through my validation in the "ADD TO PRJECT" button. Why is the tabbing from the last button to the first field triggering this even?

Thanks,
 
While you think you're tabbing from the last control of the current record to the first control of that record, you're actually moving to a new record, hence the premature (to your mind) firing of the form's BeforeUpdate event. In Design View for the form, goto

Properties - Other and change the Cycle Property from

All Records

to Current Record.

Now, when tabbing from the last control it will go back to the first control of the current record.

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
Thank you so much! That worked perfectly!

Kim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top