BeforeUpdate event executing too many times

fearless

New member
Local time
Tomorrow, 00:35
Joined
May 2, 2005
Messages
8
I have a mainform with a search function so the user can select a record to view and update. The selected record is displayed in Subform1 on Page1 of a tab control. The record source of this form is Query1. Page2 of the tab control contains Subform2; record source is the result of Query1 joined to Query2.

The forms correctly displays, updates and adds records my problem occurs when I add VBA code to the BeforeUpdate event of a control on Subform1. The code appears to execute once for each page in the tab control.

Has anyone any suggestions on how I can correct my problem.

Thanks

Fearless
 
You really have *not* given us enough to go on but here's some pointers:
...problem occurs when I add VBA code to the BeforeUpdate event of a control on Subform1.
"of A control or THE SubForm1 control? The BeforeUpdate event of the SubForm will fire every time the Dirty property is true and you either move off of that record, requery the Subform or move the focus off of the SubForm. For it to fire more than once indicates you are changing something after the record was saved at least once. Walking the code with Debug might prove to be an eye opener.
 
Thanks for your reply. It prompted me to review my design and simplify what I am trying to do.

Fearless
 
Simplify is a good thing. Always glad to help someone in a good direction. :)
 

Users who are viewing this thread

Back
Top Bottom