Hiya. I'm trying to get a report to print out from a certain form and print just the info in the form that is onscreen. It's working EXCEPT I'm getting a pop-up when I click the print button where it asks for paremeters.
Here is my code attached to my button:
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 = "[Child ID] = " & Me.[Child ID]
DoCmd.OpenReport "Child Card Print", acViewNormal, , strWhere
End If
End Sub
I'm using my field of "Child ID" instead of my primary key since that's hidden. But when I click the print button, it keeps asking me for the Child ID I want to print. I just want it to print the Child ID of the form that is currently open!
What am I missing here?!
Thanks so much for the help!