M
Meilu
Hello,
I have a general question.
Below is a Query I wrote which uses a Form field as it's
parameter:
Query is called: qryClientContact
SELECT tblContact.EntityName, tblContact.ContactName,
tblContact.EntityType
FROM tblContact
WHERE (((tblContact.EntityName)=[Forms]![frmClientPO]!
[Client Name]) AND ((tblContact.EntityType)='Client'));
This query works fine on its own. But here's the problem.
I try to use it after clicking a button on the Form:
frmClientPO
This is the code I use to try to open the query.
Dim strQry As String
Dim cInfo As String
strQry = "qryClientContact"
Set db = CurrentDb()
Set rec = db.OpenRecordset(strQry)
But the error I get is:
Too few parameters, 2 expected.
I know it has something to do with using the Form fields
as parameters... but I don't know how to get around it?
Any ideas?
Meilu
I have a general question.
Below is a Query I wrote which uses a Form field as it's
parameter:
Query is called: qryClientContact
SELECT tblContact.EntityName, tblContact.ContactName,
tblContact.EntityType
FROM tblContact
WHERE (((tblContact.EntityName)=[Forms]![frmClientPO]!
[Client Name]) AND ((tblContact.EntityType)='Client'));
This query works fine on its own. But here's the problem.
I try to use it after clicking a button on the Form:
frmClientPO
This is the code I use to try to open the query.
Dim strQry As String
Dim cInfo As String
strQry = "qryClientContact"
Set db = CurrentDb()
Set rec = db.OpenRecordset(strQry)
But the error I get is:
Too few parameters, 2 expected.
I know it has something to do with using the Form fields
as parameters... but I don't know how to get around it?
Any ideas?
Meilu