I am trying to resolve a problem where I need to create a report that is generated from the uniqueID number allocated in a table as an autonumber.
My code looks like this:
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "rpt Trial'"
stLinkCriteria = "[OpCommandID] = 1,3,4,7"
DoCmd.OpenReport stDocName, acPreview,,stLinkCriteria
It is the link criteria in line 4 that I cannot seem to get right. The intention is to put the details of unique ID 1, 3, 4 and 7 from a single table into the report. If I take out the '3,4,7' bit from the code, then the report generated reflects record 1 correctly. As soon as I add more numbers to the mix, I keep getting syntax errors.
Can anyone give me an idea of how I can do this? Thanks