G
Guest
I've been through the gamut of other threads responding to similar requests,
and have been unable to find a solution that works. From a form, I want to
click a command button, and have a coversheet print out with the current
record's info only.
The following code (courtesy of Allen Browne's response to another) gives me
an error - "The expression On Click you entered as the even property setting
produced the following error: Ambiguous name detected: cmdPrint
Coversheet_Click". When I try changing the name in the first line below, I
get no error, but nothing at all happens.
Private Sub cmdPrintCoversheet_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 = "[DocumentID] = " & Me.[DocumentID]
DoCmd.OpenReport "rptPCCoversheet", acViewPreview, , strWhere
End If
End Sub
Thanks for reading this far,
and have been unable to find a solution that works. From a form, I want to
click a command button, and have a coversheet print out with the current
record's info only.
The following code (courtesy of Allen Browne's response to another) gives me
an error - "The expression On Click you entered as the even property setting
produced the following error: Ambiguous name detected: cmdPrint
Coversheet_Click". When I try changing the name in the first line below, I
get no error, but nothing at all happens.
Private Sub cmdPrintCoversheet_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 = "[DocumentID] = " & Me.[DocumentID]
DoCmd.OpenReport "rptPCCoversheet", acViewPreview, , strWhere
End If
End Sub
Thanks for reading this far,