?
Solved

MS Access - Close pop-up form when clicking main form

Posted on 2012-12-28
4
Medium Priority
?
551 Views
Last Modified: 2012-12-28
I have two forms in a MS Access 2007 database:

frmDataEntry, frmAdjustmentsPopup

frmDataEntry has an event that causes frmAdjustmentsPopup to open.

Rather than have the user click frmAdjustmentsPopup's close button, I would like frmAdjustmentsPopup to close when the user clicks anywhere within frmDataEntry.

I realize this may seem trivial, but this would greatly improve data entry speed.

frmDataEntry is set as continuous forms.
frmAdjustmentsPopup opens with Popup = Yes, Modal = No.

It has to remain Popup = Yes as frmDataEntry runs maximized and has to stay that way, and frmAdjustmentsPopup should not be maximized when opened.  

frmAdjustmentsPopup's On Lost Focus and On Deactivate events do not capture the event of clicking on frmDataEntry.

frmDataEntry's Form_Activate, Form_GotFocus, Form_MouseDown events do not capture the event of leaving the popup form and going back to frmDataEntry.

Edit:
One thing I just read is this:
The Activate event doesn't occur when a form receives focus back from a dialog box, popup, or another form.

So, I need a workaround for this, as I have to run this as a popup.
0
Comment
Question by:HomerTNachoCheese
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 48

Accepted Solution

by:
Dale Fye earned 2000 total points
ID: 38727835
Have you tried the Current event of frmDataEntry?

It will fire whenever a record on that form receives the focus by clicking on the record selector or in any of the appropriate fields of the record
0
 
LVL 6

Author Comment

by:HomerTNachoCheese
ID: 38727844
It may work, seems more simple than another workaround I was about to attempt.  Trying it in a few...
0
 
LVL 6

Author Comment

by:HomerTNachoCheese
ID: 38727853
Works perfectly!  That was easy and runs efficiently.
0
 
LVL 6

Author Closing Comment

by:HomerTNachoCheese
ID: 38727855
There is a lot of code that fires all over the place in this program, as it is a complex home-grown payroll data entry and attendance tracking program.  This method runs with zero delays, and is the perfect solution.  

Thanks for the help!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question