I am having a problem getting the do.cmd.openreport to work for me. I have a form, which I have a botton on. The on_click for the button has the follow. All I am trying to do is when I have the form open, click the button to open the report with the current record in the preview screen.
Private Sub Command382_Click()
DoCmd.OpenReport "CAREmail", acViewPreview, , "LabNum = " & Me.LabNum
End Sub
So if I have the form open, with a record showing...When I click the button, the report opens but is blank (no record).
I have a report called "CAREmail" which is basically a copy of the form. If I open the report independantly, it seems to work fine. One of my questions that might be part of the problem, the key in the table is called "LabNum", the box on the form that shows the key is "ID". Which should I be showing in the DoCmd? Any other ideas what I am doing wrong?
Thanks
Chris