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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form Lost Focus

Status
Not open for further replies.

griswom

Technical User
May 13, 2002
40
0
0
US
Hi All...

Is there any way to tell which form just lost the focus? I have a field on a form that I would like to populate with a value from the form that preceeded it, but that form could be one of a few different forms. Any ideas?

Thanks in advance!

Griz

 
I don't think there's a specific 'right' way to do this but here is a possible method:

You could create a module with a global variable:

Code:
Global LastForm as String

And whenever a form loses focus, it could update this variable with its name.

This way, the variable could read/written from anywhere to check which form last lost focus.

Small warning: Whenver your database is started up, you might want to initially give the LastForm variable some initial state so you don't have the possibility of playing around with a null variable by accident.
 
Jucius,

Thanks for the tip. I'll give that a shot.

Griz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top