9swampy
asked on
Access XP Popup Form_GotFocus/Form_Activate
Problem:
Access (2k2/XP) Form_GotFocus and Form_Activated are not firing when a form is a popup; but that's what I need. Anyone know a workaround/solution? While I'm here; is this a "bug" or a "design feature", and if so.. why!?
Background:
I've a main "continuous" form displaying multiple records. I've a toggle button to load a **popup** window displaying data relevant to the current record on the continuous form, this popup may be multiply instantiated. The toggle button refreshes On_Current, and the relevant popup form is "SetFocus"ed. This all works fine. Now I want to do the reverse...
If I, by mouse, SetFocus on one of the popup forms I want the cursor location on the main continuous form to move to the relevant record. However, Form_GotFocus/Form_Activat ed are not firing as the forms are popups. I really don't want to change the popup forms to be normal forms if possible, but can anyone suggest a way around the lack of Form_GotFocus/Form_Activat ed event?
Many thanks in anticipation
Justin
Access (2k2/XP) Form_GotFocus and Form_Activated are not firing when a form is a popup; but that's what I need. Anyone know a workaround/solution? While I'm here; is this a "bug" or a "design feature", and if so.. why!?
Background:
I've a main "continuous" form displaying multiple records. I've a toggle button to load a **popup** window displaying data relevant to the current record on the continuous form, this popup may be multiply instantiated. The toggle button refreshes On_Current, and the relevant popup form is "SetFocus"ed. This all works fine. Now I want to do the reverse...
If I, by mouse, SetFocus on one of the popup forms I want the cursor location on the main continuous form to move to the relevant record. However, Form_GotFocus/Form_Activat
Many thanks in anticipation
Justin
ASKER
Thanks mx, but unfortunately turning off popup defeats the purpose. I need to be able to allow the users to continue to use real-estate beyond the bounds of the main Access window. I can retrieve "correct" Form_GotFocus & Form_Activate behaviour by simply turning off pop-up and have code that does all the refreshing correctly, but it's the pop-up functionality I'm hoping to retain.
9s .... what I posted sort of emulates Popup/Dialog .... no additional code will be executed from the calling form until your popup form is closed.
mx
mx
ASKER
Thanks mx, but unfortunately turning off popup defeats the purpose. I need to be able to allow the users to continue to use *screen-space* beyond the bounds of the main Access window.
I've just given in for now and forced my users to stay within the Access main window by turning off popup so I get the Form_[De]Activate events back again. They're not happy, I'm not happy, but by no means the first compromise I've had to make in my time!
I've just given in for now and forced my users to stay within the Access main window by turning off popup so I get the Form_[De]Activate events back again. They're not happy, I'm not happy, but by no means the first compromise I've had to make in my time!
ASKER
Noticed additionally that while popup = true if you explicitly reference the main form from the called form and attempt an oMainForm.Dirty = False then SQL Server gets totally locked out and I have to kill the application to get going again. Hmm. Useful.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Here is your workaround:
Turn off Popup and/or Modal.
Then use this code to open your form.
Private Sub Command10_Click()
DoCmd.OpenForm "YourFormName"
Do
DoEvents 'VERY IMPORTANT
Loop Until CurrentProject.AllForms("Y
End Sub
Note also ... the Form_GotFocus will only trigger if the form has No controls ... as mentioned in the Help file.
mx