Last form to have focus

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way to determine which form had the focus before the current one?

Daniel P
 
Yes, and I do this all the time.


For ALL of my forms, I have a form level module var called

Option Explicit

dim frmPrevious as form.

Then, in the forms on-open (in fact, you can even do this in the forms
on-load)., I go:

set frmPrevious = `Screen.ActiveForm

Now, in my form, I *always* have a reference to the previous form. I can in
code go:

frmPrevous!Companyname = me!Companyname
frmPrevous.Refresh ' force a disk write in the previous form

etc. etc. etc.

So, keep in mind that the even as late as the forms on-load event, the
current form does NOT become the active form until the on-load event is
actually finished....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top