Problem Opening a Form from a Report

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

Guest

I have a form with unbound text boxes on it to hold the selection parameters
for a report. The form is opened by the reports OnOpen event (DoCmd.Open form
"frmParameter", acNormal, "", "", acEdit, acDialog)
My problem started when I added a button to the form opening a second lookup
form. When I only open the form the second form opens on top of the parameter
form and I can perform the lookup and close the lookup form, it all works
fine. BUT when I open the parameter form through the reports OnOpen event the
lookup form opens behind the parameter form and never gets the focus. What am
I doing wrong?
 
The acDialog parameter is setting the form to a modal form. A modal form
will always have the focus. If you remove that parameter it should work as
you expected.
 
You could also set the 'popup' and 'modal' properties of the lookup form to
true which would force it to the top as well.
 
Back
Top