M
mattthr
Guest
Hi,
Having forced a form to close after generating a report, I find that (of
course) the focus is taken away from the report, given to the form as it
gets closed and is then given the oldest object available, which happens to
be the 'default' form through which the user gets at the database. The
report is thus open but hidden. How can I make sure the focus goes back to
the report after the form closes? I've tried putting:
Private Sub Form_Unload(Cancel As Integer)
DoCmd.SelectObject acReport, "Date or Delivery Ref Query", True
End Sub
In the form code, but although the code is valid, it doesn't give the focus
back to the form. It doesn't work if you swap 'true' for 'false' either.
Cheers
Having forced a form to close after generating a report, I find that (of
course) the focus is taken away from the report, given to the form as it
gets closed and is then given the oldest object available, which happens to
be the 'default' form through which the user gets at the database. The
report is thus open but hidden. How can I make sure the focus goes back to
the report after the form closes? I've tried putting:
Private Sub Form_Unload(Cancel As Integer)
DoCmd.SelectObject acReport, "Date or Delivery Ref Query", True
End Sub
In the form code, but although the code is valid, it doesn't give the focus
back to the form. It doesn't work if you swap 'true' for 'false' either.
Cheers