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!

Bypass in BeforeUpdate event

Status
Not open for further replies.

kimsMTC

Programmer
May 30, 2007
50
US
I have a form and subform created. The form only allows the user to add a single time record to their timesheet at one time. After the ADD TO TIMESHEET button is clicked, the record is added to the subform (called TimesheetRecords) for the user to easily see what has been added. A Requery is also performed. The user also has the option of deleting a Timesheet Record fromt he subform.

My problem is that when the form is first opened, a new record is created. However, if I do not want to add a new record and just want to click on an existing record in the subform, I get the referential integrity error message saying that I haven't added all the required fields for the new record. What code can I put int he BeforeUpdate event to stop the adding of the record fromt he form?

Thanks in advance!
 
Cancel = True

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I tried Cancel=True but then it prevents my subform from being accessible. What am I missing?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top