Events - What is evaluated first. (1 Viewer)

Mark Liddle

Registered User.
Local time
Today, 03:15
Joined
Sep 12, 2000
Messages
13
In what order, are events processed ?
I have an event on a field that must check the following.

1. Is there data in the field (I have placed this in the "Lost Focus" event)

2. If there is data, then generate an account code. (This has been placed in the "After_Update" event.

3. I also want to place code in the "Double_Click" event.

What If I placed checks, balances and other code in other events ? What is processed first ?
 

Mark Liddle

Registered User.
Local time
Today, 03:15
Joined
Sep 12, 2000
Messages
13
Hi Ian
Very interesting stuff. (At least for where I am at now.) - Thanks.

It certainly does answer SOME questions.
What I haven't found an answer to yet (Unless I have mis-read something or not read the relevant piece yet) is...

If I have 2 (or more events) as follows.
After Update
Do X,Y and Z

On Exit
Print a report

On lost Focus
Do A,B and C

Which of these is evaluated first.

As I understand it, the "On Exit" event occurs before the "Lost Focus".

Both the "After Update" and "On Exit" events are evaluated when the control loses focus, but in what order ?

Also, if the "After Update" fires first, will it fire before or after the "On Exit" event ?

Thanks for your input.
 

chrisk

Registered User.
Local time
Today, 03:15
Joined
Apr 24, 2001
Messages
13
Mark

This, at least, is something that Access 'help' does actually help with. Search for "find out when events occur" in the answer wizard and select "See the order of events for controls on forms". I've got A2k now, but I know it's in A97 help too.

Chris.
 

D-Fresh

Registered User.
Local time
Today, 03:15
Joined
Jun 6, 2000
Messages
225
And of course the other solution being to throw some test lines in there. Create a form and put the control you want to find out the order. In each event you're looking for put a msgbox stating which event just fired, i.e. msgbox "Lost Focus" in the LostFocus event. Kind of a cheap way to do it, but it works. Hope that helps.

Doug
 

Mark Liddle

Registered User.
Local time
Today, 03:15
Joined
Sep 12, 2000
Messages
13
Thanks for your comments gents.
I guess I'm still thinking too much IN the box.
 

Users who are viewing this thread

Top Bottom