Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there a VBA event for both changing records or exiting form?

Status
Not open for further replies.

bcooler

Programmer
Jun 13, 2009
132
I have some VBA in my form that adds a form completion date to the associated table when an operator completes the form and presses the "exit" button. If the user instead just leaves the database or goes to another record and then exits, I get missing date data.

I know the "On Exit" event works. I just need help with record change and just plain Access closing. I've thought of having "On Current" events and call this event in the "On Exit" event (so I don't duplicated code in both places). Will this work? Are there any other events that covers the event called "any time the user leaves the record, no matter how they do it"?
 
Why not simply use the BeforeUpdate event ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
That's the Form_BeforeUpdate() event

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
Thanks! I think this will work.

Do you happen to know of a website that lists all the events and good examples of their uses and the logic behind their use? I can sort of understand a little by the event name, but I know I'm missing the subtle things like event order and when you use one over another.
 
bcooler said:
[blue]Do you happen to know of a website that lists all the events and good examples of their uses and the logic behind their use?[/blue]
You have access help right there, and its not bad!
[ol][li]In formview put the cursor on [blue]any event or property line[/blue] and hit [blue]F1[/blue] to read about it.[/li]
[li]In VBA put the cursor within a key word and hit [blue]F1[/blue] to read about it.[/li][/ol]

Its called [blue]context sensitive help![/blue] ...

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top