Re: combine events to create a condition
- From: Harry <Harry@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 7 Sep 2006 11:08:01 -0700
Thanks for the input. However, my form is still unable to distinguish between
adding a record and editing a current record. I want to get prompted ONLY
when I’m editing an existing record. BeforeUpdate (like AfterUpdate) doesn’t
allow for that. I figure I need some additional code to allow for that
judgment to be made.
"Douglas J. Steele" wrote:
Access doesn't actually save the changes until you move to another record,.
not when you move to another field in the same record.
If you're concerned, put code into the form's BeforeUpdate event: that fires
just before Access tries to write to the table (and you can set Cancel =
True to stop the update from taking place)
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"Harry" <Harry@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:B5C4EE0E-EFA9-47CC-9A70-8970C79D64DE@xxxxxxxxxxxxxxxx
AfterUpdate is seemingly the obvious choice. I want to do something more
complicated and I should have given more details in my first note. Here is
some more information. I have a form where I am adding new customers into
a
database. There are some text boxes and combo boxes. I also have two combo
boxes that allow searching existing records. I want to be able to add new
records and edit and delete existing ones. No big deal.
I don't want Access to automatically save any edits that I make. I know
that
can be a nice feature but I want to work around this built-in behavior.
The
setup I want is to help avoid accidental changes in existing records. If I'm
editing an existing record, I want to be prompted (run a macro that I have
created) as I go to another field (Do you want to save this? Yes or No).
If
I'm adding a new record, I don't want to be prompted as I go to another
field. I would just be prompted at the end when I try to save or close the
form. AfterUpdate won't allow for that flexibility. I get prompted if I'm
adding or editing a record. I think there needs to be some kind of
combination of two or more conditional events (On Changes and On
LostFocus?)
or something like that. Help me make this a relatively goof-proof
database.
Thanks.
"ruralguy via AccessMonster.com" wrote:
That event has already been created for you by Microsoft. It is called
the
AfterUpdate event.
Harry wrote:
I am trying to change the properties in a text box in my form. If
changes (On
Change) are made to the text box and you move (On LostFocus) to a
different
field, then I want to run a macro. I can't figure out how to code this
or
combine these two events as a condition.
--
HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200609/1
- Follow-Ups:
- Re: combine events to create a condition
- From: Douglas J. Steele
- Re: combine events to create a condition
- References:
- Re: combine events to create a condition
- From: ruralguy via AccessMonster.com
- Re: combine events to create a condition
- From: Douglas J. Steele
- Re: combine events to create a condition
- Prev by Date: Forms and subforms
- Next by Date: Re: Search text/memo field
- Previous by thread: Re: combine events to create a condition
- Next by thread: Re: combine events to create a condition
- Index(es):
Relevant Pages
|