I have 2 select queries and 1 append union query that uses the 2 select queries. The select queries use [TempVars] in the where clause. Im trying to call the append query from vba, DoCmd.Execute qryName, but I get a Run-time error 3061 - Too few parameters. Expected 3.
I've searched and tried several things to set the parameters before calling the append query but still get the error. The append query does not use any [TempVars]'s.
Try 1:
For Each p In qd.Parameters
p.Value = Eval(p.Name)
Next
Try 2:
Set qd = db.QueryDefs("qryManagerRanking100")
qd.Parameters("[TempVars]![FacLevel]").Value = [TempVars]![FacLevel]
docmd.execute "qryManagerRanking100"
How do I pass variables to a query that is being called from the query I execute?