Error 3061

  • Thread starter Thread starter ifcgroup
  • Start date Start date
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...
 
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 & "'")
 
Thank you so much!! You were absolutely right... I changed it to what
you said to add the ' marks.
 
Back
Top