What am I doing wrong?? 
Author Message
 What am I doing wrong??

Hi there you all!!
A question:
I'm trying to make a query in the OpenRecordset statement
as follows but VB answers that there are "Too few
parameters, Expected 1."
Do you have any idea what I'm doing wrong??
([CmboProjectName] is a ComboBox in my Form)

Set Dbs = CurrentDb
Set ActRst = Dbs.OpenRecordset("SELECT * FROM Activity
WHERE (((Activity.ProjectName) = [CmboProjectName].
[Value]))", dbOpenDynaset)

Thanks
Perry



Fri, 25 Mar 2005 19:17:50 GMT  
 What am I doing wrong??
Perry try this,

Set ActRst = Dbs.OpenRecordset("SELECT * FROM Activity  WHERE ProjectName =
'" &  [CmboProjectName] & "'", dbOpenDynaset)
a string need to be inclosed by single quotes

Ed



Quote:
> Hi there you all!!
> A question:
> I'm trying to make a query in the OpenRecordset statement
> as follows but VB answers that there are "Too few
> parameters, Expected 1."
> Do you have any idea what I'm doing wrong??
> ([CmboProjectName] is a ComboBox in my Form)

> Set Dbs = CurrentDb
> Set ActRst = Dbs.OpenRecordset("SELECT * FROM Activity
> WHERE (((Activity.ProjectName) = [CmboProjectName].
> [Value]))", dbOpenDynaset)

> Thanks
> Perry



Fri, 25 Mar 2005 20:27:55 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Recordset: What am I doing wrong?

2. What am I doing wrong?

3. Help with syntax. What am I doing wrong

4. What am I doing wrong?

5. What am I doing wrong?

6. What am I doing wrong?

7. What am I doing wrong? -MultiSelect List box

8. Select Case - What am I doing wrong?

9. What am I doing wrong (easy).

10. OLE problem, or what am I doing wrong?

11. What am I doing wrong?

12. Footer/Page # - What am I doing wrong?

 

 
Powered by phpBB® Forum Software