Re: combine events to create a condition

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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





.



Relevant Pages

  • Re: Edit text in box
    ... Editing them by right-clicking & choosing Edit Picture most likely produced ... That would produce the collection of editable text boxes. ... Even with Track Changes turned on the editing ... I have the option to "Protect Document" - so the ...
    (microsoft.public.word.docmanagement)
  • AfterUpdate Problems
    ... edit information. ... The text boxes use ... move to the next and try editing the remarks on the second record. ... happen when going from the first record to the second record and not others. ...
    (microsoft.public.access.formscoding)
  • Re: TS 2k3 - client settings tab, all options greyed out???
    ... out boxes by editing the group policy, even though the options in the ... admin rights in the domain, they get a login screen and can enter their ...
    (microsoft.public.win2000.termserv.clients)
  • Make Combo Box ReadOnly?
    ... I have a number of controls on a tab and they display data but I want to ... prevent the user from editing them. ... I set the ReadOnly property ... of the text boxes to true which displays the data in a dark font on a gray ...
    (microsoft.public.dotnet.languages.vb.controls)
  • Re: combine events to create a condition
    ... There are some text boxes and combo boxes. ... combination of two or more conditional events (On Changes and On ... LostFocus?) ... HTH - RuralGuy acXP WinXP Pro ...
    (microsoft.public.access.formscoding)