Report sticking

wailingrecluse

Registered User.
Local time
Today, 23:09
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?

Code:
Private Sub Detail_Click()
DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport "RequestReport", acViewPreview, "[RequestID] = " & [RequestID]
Reports!RequestReport.Visible = True

End Sub
 
Why are you clicking on the detail section background to generate the report? You should be using a command button. That may be the issue.
 
Sorry, I don't think I was clear enough... After clicking the button, I could wait upwards of a minute with nothing happening, but then when I click on the form body, suddenly the report generated.

turns out the code was wired up to the wrong button, it's working now

Thanks anyway
 

Users who are viewing this thread

Back
Top Bottom