I've got an append parameter query where I have [Enter Form Type] in the criteria of a field (this is the only parameter). I've also put this in Queries/Parameters:
Parameter Data Type
[Enter Form Type] text
I'm trying to set the parameter in VBA and run the query, but I keep getting the error "too few parameters, expected 1"
Here's my code:
Dim MyDB As Database, MyQuery As QueryDef
Set MyDB = CurrentDb
Set MyQuery = MyDB.QueryDefs("q_GetRecordsForOneFormType"
MyQuery("[Enter Form Type]" = "A"
MyDB.Execute (MyQuery.Name)
I've also tried the following
MyQuery("Enter Form Type" = "A"
MyQuery.Parameters("Enter Form Type" = "A"
MyQuery.Parameters("[Enter Form Type]" = "A"
but nothing seems to work. Any ideas?
TIA
Parameter Data Type
[Enter Form Type] text
I'm trying to set the parameter in VBA and run the query, but I keep getting the error "too few parameters, expected 1"
Here's my code:
Dim MyDB As Database, MyQuery As QueryDef
Set MyDB = CurrentDb
Set MyQuery = MyDB.QueryDefs("q_GetRecordsForOneFormType"
MyQuery("[Enter Form Type]" = "A"
MyDB.Execute (MyQuery.Name)
I've also tried the following
MyQuery("Enter Form Type" = "A"
MyQuery.Parameters("Enter Form Type" = "A"
MyQuery.Parameters("[Enter Form Type]" = "A"
but nothing seems to work. Any ideas?
TIA