G
Guest
I absolutely can not get this parameter query to work. Should the parameter
index value just be a field name, yes? i.e. parameters("myAuthority") refers
to the field "myAuthority" in my query. Weirdly, qdf.parameters.count always
shows 0.
Dim db As Database
Dim rs As DAO.Recordset
Dim qdf As QueryDef
Set db = CurrentDb
Set qdf = db.QueryDefs("Authorities") 'Authorities is a basic two-field query
qdf.parameters("myAuthority").value = "BC" '**Where I want to see records
like BC
Set rs = qdf.OpenRecordset
Do While rs.EOF = False
thisAuthority = rs(1).Value
rs.MoveNext
Loop
On another post, someone suggested using SET qdf.parameters("myAuthority"),
but this also results in errors. This is so basic, I'm sure!! I just need the
exact syntax!
index value just be a field name, yes? i.e. parameters("myAuthority") refers
to the field "myAuthority" in my query. Weirdly, qdf.parameters.count always
shows 0.
Dim db As Database
Dim rs As DAO.Recordset
Dim qdf As QueryDef
Set db = CurrentDb
Set qdf = db.QueryDefs("Authorities") 'Authorities is a basic two-field query
qdf.parameters("myAuthority").value = "BC" '**Where I want to see records
like BC
Set rs = qdf.OpenRecordset
Do While rs.EOF = False
thisAuthority = rs(1).Value
rs.MoveNext
Loop
On another post, someone suggested using SET qdf.parameters("myAuthority"),
but this also results in errors. This is so basic, I'm sure!! I just need the
exact syntax!