Error 3061

I

ifcgroup

Private Sub LookupClause_Click()
Dim db As DAO.Database
Dim queryResults As DAO.Recordset
Set db = CurrentDb
Set queryResults = db.OpenRecordset("SELECT Contract FROM Aircraft
WHERE Aircraft = " & Me.IssueAircraft)


I'm getting the "error 3061 too few parameters expected 1" on the
Set queryResults line... and I know it's something small but I can't
figure it out. Any ideas? I have used the same code elsewhere and it
seems to be working fine. Thanks...
 
K

Ken Snell \(MVP\)

Is the Aircraft field a text data type? If yes, delimit the value from the
form's control with ' characters:

Set queryResults = db.OpenRecordset("SELECT Contract FROM Aircraft
WHERE Aircraft = '" & Me.IssueAircraft & "'")
 
I

ifcgroup

Thank you so much!! You were absolutely right... I changed it to what
you said to add the ' marks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top