Thank you in advance for your help.
I am trying to print a report with VBA that restricts the output to one specific test. I am getting a type mismatch error. I think I am using the syntax for a string. The data is an integer. Below is the code that gives a type mismatch error.
Dim stDocName As String
Dim intLinkCriteria As Integer
stDocName = "Result Letter"
intLinkCriteria = "[Test Number]=" & "'" & Me![Test Number] & "'"
DoCmd.OpenReport stDocName, acViewPreview, , stLinkCriteria
What would be the correct syntax?