Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2003
    Posts
    33

    Unanswered: to few parameters....

    I am using the following code to open and update a recordset selected in a form:


    Private Sub SaveButton_Click()
    dim rst as Recordset
    set rst=CurrentDb.OpenRecordset(" select * from tblSubCO where SubCOID="& txtSubCOID)
    rst.Edit
    'update selected records from entries
    rst!SubCODate=txtSubCODate
    'set field values here
    rst.Update
    rst.Close
    Set rst=Nothing

    End Sub

    I get a "to few parameters; expected 1" errror. I tried using db.QueryDefs but I don't think I was getting that right. I'm not very good at this sort of thing.

    t

  2. #2
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    try
    ...SubCOID='" & txtSubCOID & "'"

    izy

  3. #3
    Join Date
    Dec 2002
    Location
    Glasgow, UK
    Posts
    100
    the txtSubCOID should be

    me.txtSubCOID

Posting Permissions

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