Help! - Runtime Error 3061:Too Few parameters Expected

CBO

Registered User.
Local time
Today, 00:40
Joined
Aug 8, 2005
Messages
10
Can someone help me:

I'm not sure what I'm doing wrong, can someone please help me out.
I get a runtime error 3061: Too few parameters Expected 1 when I run the following code below.

Dim rst As DAO.Recordset

Set rst = CurrentDb.OpenRecordset("SELECT * FROM [FRL Codes] WHERE [20YR] like EQPAR132;")

****NOT USING A FORM, JUST WANT TO SELECT FROM A TABLE****

Thanks
CBO
 
Last edited:
CBO,

What is EQPAR132?

If it is a constant:

Set rst = CurrentDb.OpenRecordset("SELECT * FROM [FRL Codes] WHERE [20YR] = 'EQPAR132';")

If it is a form variable equating to a string:

Set rst = CurrentDb.OpenRecordset("SELECT * FROM [FRL Codes] WHERE [20YR] = '" & Me.EQPAR132 & "';")

If you really want to use Like, you need a wildcard:

Set rst = CurrentDb.OpenRecordset("SELECT * FROM [FRL Codes] WHERE [20YR] Like '*EQPAR132*';")

Need more info,
Wayne
 
Thanks Wayne RE: Runtime Error Help !!!

The first one worked just by adding the single quotes....You rock!!


:) Thanks CBO
 

Users who are viewing this thread

Back
Top Bottom