C
cindyn
I am opening a report via VB code, using DoCmd.OpenReport. It works great,
but it always opens the report behind several other forms that may be open at
the time. I would like it to be opened in front of (on top of) everything
else that's open. All the forms and the report are NOT Popup or Modal.
Are there any options like this out there? I couldn't
find any.
I also thought to try forcing the focus to it, but
because it's doing it dynamically from a list box based on the currently
selected row (thus report) to open, I don't have a specific report name so I
can't figure out the syntax to SetFocus when you are using the .Value
property.
My code looks like this:
With Me!lstReportList
If IsNull(.Value) Then
MsgBox "Please select a report first!"
Else
'Open the selected report
DoCmd.OpenReport .Value, acViewPreview
'Close the select report form
DoCmd.Close acForm, "Report List", acSaveNo
' Set focus to the just opened report
'.Value SetFocus -- this is the syntax I can't figure out
End If
End With
but it always opens the report behind several other forms that may be open at
the time. I would like it to be opened in front of (on top of) everything
else that's open. All the forms and the report are NOT Popup or Modal.
Are there any options like this out there? I couldn't
find any.
I also thought to try forcing the focus to it, but
because it's doing it dynamically from a list box based on the currently
selected row (thus report) to open, I don't have a specific report name so I
can't figure out the syntax to SetFocus when you are using the .Value
property.
My code looks like this:
With Me!lstReportList
If IsNull(.Value) Then
MsgBox "Please select a report first!"
Else
'Open the selected report
DoCmd.OpenReport .Value, acViewPreview
'Close the select report form
DoCmd.Close acForm, "Report List", acSaveNo
' Set focus to the just opened report
'.Value SetFocus -- this is the syntax I can't figure out
End If
End With