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

Is there a way to prevent BeforeUpdate from firing??

P: n/a
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

May 17 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Bri


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

May 17 '06 #2

P: n/a
Well, at least I tried.
I redesigned the form so all the required data entry precedes the
subform and I will simply explain why it's done the way it is...
Maybe someone else knows an automagical solution...
Thank you, Tom

May 17 '06 #3

P: n/a
You cant stop the beforeupdate event running, that doesn't mean to say you
have to run the code in there.

Use a variable to indicate the state of the record and decide whether to run
the code.

Of course you can't have any required fields not filled in as this is a
database level validation.
--

Terry Kreft
"tlyczko" <tl*****@gmail.com> wrote in message
news:11**********************@j33g2000cwa.googlegr oups.com...
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

May 18 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.