Hi,
I'm intending to print a number of reports for the current record from a print button on a form. I have what i think the code should look like but when the print button is pressed it prints the first report (Title Page) as desired but doesn't print the other 3 and prompts for an ID. How do i get it to keep the same record 'selected'?
Code:
Private Sub cmdPrint_Click()
Dim strWhere As String
If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If
If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[ID] = " & Me.[ID]
DoCmd.OpenReport "Title Page", acViewNormal, , strWhere
DoCmd.OpenReport "Information Index", acViewNormal, , strWhere
DoCmd.OpenReport "Sterilisation Sheet", acViewNormal, , strWhere
DoCmd.OpenReport "Label Request", acViewNormal, , strWhere
End If
End Sub
Thanks in advance for any help.
James