This code below loops through all the ID's in the temporary table and opens a report for them but only if it finds the ID. How do I get it to open a report for it even if it doesn't?
For example say the table contains ID's 1-10 and I type 15, I want the report to open with something like "Not found".
I thought about rewriting this as a for loop that cycles through the ID's using DAO but I think it would open a different report for each ID. Not to mention I would have to import DAO and get rid of ADO (its an old DB)
Code:
Me.Dirty = False
Dim StrSql As String
StrSql = "SELECT ID FROM TempPullsTable"
nz(DoCmd.OpenReport("PullsReport", acViewPreview, , "Autonum IN (" & StrSql & ")"),