Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / July 2007

Tip: Looking for answers? Try searching our database.

Last form to have focus

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Daniel - 05 Jul 2007 22:42 GMT
Is there a way to determine which form had the focus before the current one?

Daniel P
Albert D. Kallal - 06 Jul 2007 01:08 GMT
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....

Signature

Albert D. Kallal    (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal@msn.com

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.