Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2002
    Location
    Hartford, CT
    Posts
    106

    Unanswered: Run time error '3061'

    Hi,

    I have this piece of code under a combo box.change on an access form to populate two text fields.

    SqlStr = "SELECT Employee.First_name,employee.last_name FROM Employee Where Employee_id = me.Cashair_id.Value"

    Set rst = CurrentDb.OpenRecordset(SqlStr, dbOpenDynaset)

    I am getting this error on the SET line

    (Too few parameters. Expected 1)

    I am using this piece of code in other areas and it is working but not here.

    Please help.

    Thanks a lot.
    Mo

  2. #2
    Join Date
    Jan 2003
    Location
    Aberdeen, Scotland, UK
    Posts
    168
    SqlStr = "SELECT Employee.First_name,employee.last_name FROM Employee Where Employee_id = " & me.Cashair_id.Value

    Usefull?
    J.

  3. #3
    Join Date
    Oct 2002
    Location
    Hartford, CT
    Posts
    106
    That worked great to retrieve the date but I got another error trying to populate the fields.

    (You cannot reference a property or method of a control unless the control has the focus)

    Any idea on who to get around this?

    Thanks a lot.
    Mo

  4. #4
    Join Date
    Jan 2003
    Location
    Aberdeen, Scotland, UK
    Posts
    168
    SqlStr = "SELECT Employee.First_name,employee.last_name FROM Employee Where Employee_id = " & me.Cashair_id

    just remove the '.value'
    J.

  5. #5
    Join Date
    Oct 2002
    Location
    Hartford, CT
    Posts
    106
    Hi that did not change the results but I tried coding to set the focus to the filed before updating it, and it worked.

    Thanks a lot for your help.
    Mo

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •