I am trying to open a recordset through a variable passed in like this:
Function fConcatChild2(rsDI As Integer) As String
.....
Set rs = db.OpenRecordset("Select [PACP Defect] From [Inspections Detail] Where [ID] = rsDI", dbOpenSnapshot)
I am getting an error:
Run-time error '3061':
Too few parameters. Expected 1.
Then I replace rsDI with the number 32 and it works, what is the difference? I have set a watch and breakpoint before this and rsDI does = 32 when I get the error.
Working example:
Set rs = db.OpenRecordset("Select [PACP Defect] From [Inspections Detail] Where [ID] = 32", dbOpenSnapshot)