G
Guest
I have a control for printing details of an existing record only in a report
form with the following Onclick event procedure:
Private Sub Extract_Click()
On Error GoTo Err_Extract_Click
Dim stDocName As String
Dim strcriteria As String
stDocName = "Extract"
stcriteria = "Autonumber = " & Me.Autonumber
DoCmd.OpenReport stDocName, acPreview, , strciteria
Exit_Extract_Click:
Exit Sub
Err_Extract_Click:
MsgBox Err.Description
Resume Exit_Extract_Click
End Sub
When I click the control I get an error that is referring to Autonumber afer
the Me.
Could some please advise where I have gone wrong? Many thanks
form with the following Onclick event procedure:
Private Sub Extract_Click()
On Error GoTo Err_Extract_Click
Dim stDocName As String
Dim strcriteria As String
stDocName = "Extract"
stcriteria = "Autonumber = " & Me.Autonumber
DoCmd.OpenReport stDocName, acPreview, , strciteria
Exit_Extract_Click:
Exit Sub
Err_Extract_Click:
MsgBox Err.Description
Resume Exit_Extract_Click
End Sub
When I click the control I get an error that is referring to Autonumber afer
the Me.
Could some please advise where I have gone wrong? Many thanks