R
Renee
I have created a button on my employee info form to print about 6-8 reports
based on the employee number and have used this code for the on click event:
Private Sub PRINT_DOCS_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 = "[EMPLOYEE NUMBER] = " & Me.[EMPLOYEE NUMBER]
DoCmd.OpenReport "AHC", acViewPreview, , strWhere
DoCmd.OpenReport "QUICKCARD", acViewPreview, , strWhere
End If
End Sub
When I click on the button it gives me a run time error '2465': access can't
find the field 'l' referred to in your expression. I am not sure what this
error is refurring to and when I go to the debug and highlights this line of
my expression:
strWhere = "[EMPLOYEE NUMBER] = " & Me.[EMPLOYEE NUMBER]
Can anyone clear this up for me?
Thank you.
based on the employee number and have used this code for the on click event:
Private Sub PRINT_DOCS_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 = "[EMPLOYEE NUMBER] = " & Me.[EMPLOYEE NUMBER]
DoCmd.OpenReport "AHC", acViewPreview, , strWhere
DoCmd.OpenReport "QUICKCARD", acViewPreview, , strWhere
End If
End Sub
When I click on the button it gives me a run time error '2465': access can't
find the field 'l' referred to in your expression. I am not sure what this
error is refurring to and when I go to the debug and highlights this line of
my expression:
strWhere = "[EMPLOYEE NUMBER] = " & Me.[EMPLOYEE NUMBER]
Can anyone clear this up for me?
Thank you.