wailingrecluse
Registered User.
- Local time
- Today, 23:24
- Joined
- Feb 10, 2009
- Messages
- 50
All
I have a form named "Request" and a report named "RequestReport"
There is a button on the form which saves the record and then opens the report in print preview mode, showing the current record.
This works, but for some reason after I click the button I have to click on the form before the report will open.
I've tried adding a line of code to hide the form in case the report was opening behind it, but this is not helping.
Any ideas?
I have a form named "Request" and a report named "RequestReport"
There is a button on the form which saves the record and then opens the report in print preview mode, showing the current record.
This works, but for some reason after I click the button I have to click on the form before the report will open.
I've tried adding a line of code to hide the form in case the report was opening behind it, but this is not helping.
Any ideas?
Code:
Private Sub Detail_Click()
DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport "RequestReport", acViewPreview, "[RequestID] = " & [RequestID]
Reports!RequestReport.Visible = True
End Sub