tlyczko wrote:
Hello,
I think what I'm asking for may not be possible, but I'll try anyway.
I have MainForm with 3 subforms, one SubForm requires data entry, the
other two don't (optional).
MainForm has some BeforeUpdate field validation code.
I would like to do the following:
1. Enter the required date on the main form.
2. After the date is entered, save the MainForm record with the
required date value, then move the user into the SubForm without firing
the MainForm's BeforeUpdate event (set the focus to the subform).
3. Then after the SubForm gets its data (only one field is filled in),
go back to the MainForm and continue entering data.
Otherwise I have to move all the subforms to the bottom of the MainForm
and that is counter-intuitive to the way people think about this data
etc.
Thank you, Tom
Short answer, no you can't move off the newly created record and not
have the BeforeUpdate event fire.
You could have your validation code in a different location and have it
check the parent record as well as the child record (in the subform).
One idea would be to have the main form not allow additions. Then you
could have a New Button and a Save Button to control when a record is
started and ended. The validation code would be in the Save Button of
course. The New button is mearly a way to prevent the user from leaving
the current record to a new record without first saving using the save
button. In addition, the New button can activate the Save button and the
Save button can activate the New button so only one of them is active at
a time as required.
Sorry that was a bit rambly, but hopefully it will give you some ideas
to think about.
--
Bri