473,471 Members | 1,713 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Is there a way to prevent BeforeUpdate from firing??

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
3 3190
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: William Wisnieski | last post by:
Hello Everyone, Access 2000 I have a form with multiple pages on it. There is one text field on the third page of the form that I need the user to complete before leaving the form or moving...
1
by: Dalan | last post by:
Although I have used the code below to suppress the DoCmd cancel action message from appearing on lots of other actions such as preview and print, I have not been able to get to work on a...
0
by: Deano | last post by:
My beforeupdate event on the main form fires when a change has been made and the record has not been saved (2 variables are used to track this). Works great but if they make a change in my...
9
by: Daniel Walzenbach | last post by:
Hi I am faced with the following problem: I have a page (let’s call this page page1.aspx) containing some TextBoxes and a hyperlink which opens another page (let’s call this page page2.aspx)...
4
by: tlyczko | last post by:
I have been looking on the NGs and I found this code to show if a subform has no records. I have this code in the MAIN form OnClose event: Private Sub btnClose_Click() '4/16/06 new code that...
3
by: Mike-deerenews | last post by:
I would like to check for the existence of an attribute in order to prevent an exception from firing. Could someone provide an example? tia Mike
5
by: Vincent | last post by:
I have a bound listbox control on one of my forms that has an associated afterupdate event. When this event is invoked, I lock the control to prevent the user from clicking on it more than once....
2
by: APA | last post by:
Why does adding code to the form submit function using the RegisterOnSubmitStatement method prevent the server side event handler for the submit button from firing? This is completely useless. I...
7
by: Richard Sherratt | last post by:
I'm trying to stop users deleting an existing value in a field. If they go to an existing record and hit delete, I want to give an error message and reverse the change. The BeforeUpdate event is...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.