473,396 Members | 2,038 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

dirty vs change vs beforeupdate

I'm sure this is a simple one.

I have a combo box that, when its data is changed, will trigger a second
form to open for input. If the operator declines input, I want the combo
box to return to its original value. The on change event is wrong for
this, since the new data has already been saved. As I undertand it, the
beforeupdate event won't work either, since it applied to the entire form.
Would ondirty be the right event to use?

--
Message posted via http://www.accessmonster.com
Nov 13 '05 #1
4 11486
On Mon, 21 Feb 2005 15:37:51 GMT, bob bob via AccessMonster.com
<fo***@AccessMonster.com> wrote:
I have a combo box that, when its data is changed, will trigger a second
form to open for input. If the operator declines input, I want the combo
box to return to its original value. The on change event is wrong for
this, since the new data has already been saved. As I undertand it, the
beforeupdate event won't work either, since it applied to the entire
form.
Would ondirty be the right event to use?


Much of what you need to do with Access controls can be done with
BeforeUpdate and AfterUpdate. I'm not sure how you intend the "operator
declines input" thing to happen (where are they declining input?), but if
you want the combobox value change to be 'cancelable', put your code in
the BeforeUpdate event. You then set Cancel to True if you want to undo
the change.

Are you trying to handle a 'Not In List' message? There is a specific
event just for that.
Darryl Kerkeslager
Nov 13 '05 #2
What happens is that a form opens and asks for additional information.
There are several items of data that need to be supplied. If not, the
change to the combo box is rejected.

--
Message posted via http://www.accessmonster.com
Nov 13 '05 #3
On Mon, 21 Feb 2005 18:51:34 GMT, bob bob via AccessMonster.com
<fo***@AccessMonster.com> wrote:
What happens is that a form opens and asks for additional information.
There are several items of data that need to be supplied. If not, the
change to the combo box is rejected.


Then use BeforeUpdate. Open your form, and post back some sort of
returned value for 'okay' or 'cancel' (various ways to do this). the
changes are unacceptable, then

Cancel=True

in your BeforeUpdate code, which will cancel the update.
Darryl Kerkeslager
Nov 13 '05 #4
Bri
Bob,

There is a BeforeUpdate event for each control as well as for the Form.
You can put your code on the BeforeUpdate for the first Combo.

--
Bri

bob bob via AccessMonster.com wrote:
I'm sure this is a simple one.

I have a combo box that, when its data is changed, will trigger a second
form to open for input. If the operator declines input, I want the combo
box to return to its original value. The on change event is wrong for
this, since the new data has already been saved. As I undertand it, the
beforeupdate event won't work either, since it applied to the entire form.
Would ondirty be the right event to use?

Nov 13 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Rey | last post by:
Howdy all. Appreciate your help with several problems I'm having: I'm trying to determine if the Visit subform (subformVisits) has a new record or been changed, i.e. dirty. The form that...
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...
6
by: P | last post by:
Hi, I have a form with several controls. One of them is initialized through VB in frm_current. I am using the frm_beforeupdate event to prompt users for saving changes. How can I make it so that...
1
by: Ray | last post by:
I have a subform which takes one of its fields from the main form, namely the YearLevel which is from 1 to 8. There is also another field which returns the year from datePart. If I select a...
2
by: Salad | last post by:
A97. I have a command button to save and exit. I had the code If Me.Dirty Then Docmd.RunCommand acCmdSaveRecord ...more code endif I was getting an error because a value was not getting...
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: Susan Bricker | last post by:
I am currently using the OnDirty event of a Form to detect whether any fields have been modified. I set a boolean variable. Then, if the Close button is clicked before the Save button, I can put...
6
by: tlyczko | last post by:
I have a BeforeUpdate where I need to ensure that no matter what, the first four fields on the form (one text box, 3 combo box lists) have data entered in them before the user closes the form or...
8
by: evn678 | last post by:
Hello all, I am trying to handle a scenario where a user clicks the 'X' close control on a form window border. I want to force the user to use the form's 'save' button to write the updated...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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,...

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.