N
nuages
I am trying to run a parameter query that accepts user input. The
query runs in the Query Grid but will not run in VBA as in line SQL.
The SQL from the Query Grid is:
SELECT tblTestTable.ID, tblTestTable.FirstName, tblTestTable.LastName,
tblTestTable.Age
FROM tblTestTable
WHERE (((tblTestTable.FirstName)=[Enter First Name]));
When I copy this into the VBA Module I get an error "Too Few
Parameters. Expected 1"
I then tried the following (From allen Brown)
strSql = "SELECT tblTestTable.ID, tblTestTable.FirstName,
tblTestTable.LastName, tblTestTable.Age " & vbCrLf & _
"FROM tblTestTable " & vbCrLf & _
"WHERE (((tblTestTable.FirstName)=[Enter First Name]));"
But I still get the same error ie "Too Few Parameters. Expected 1"
I am using MS Access 2003 and VB 5.5
It's driving me mad and any help would be greatly appreciated.
query runs in the Query Grid but will not run in VBA as in line SQL.
The SQL from the Query Grid is:
SELECT tblTestTable.ID, tblTestTable.FirstName, tblTestTable.LastName,
tblTestTable.Age
FROM tblTestTable
WHERE (((tblTestTable.FirstName)=[Enter First Name]));
When I copy this into the VBA Module I get an error "Too Few
Parameters. Expected 1"
I then tried the following (From allen Brown)
strSql = "SELECT tblTestTable.ID, tblTestTable.FirstName,
tblTestTable.LastName, tblTestTable.Age " & vbCrLf & _
"FROM tblTestTable " & vbCrLf & _
"WHERE (((tblTestTable.FirstName)=[Enter First Name]));"
But I still get the same error ie "Too Few Parameters. Expected 1"
I am using MS Access 2003 and VB 5.5
It's driving me mad and any help would be greatly appreciated.