Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2012
    Posts
    22

    Unanswered: To few Parameters Expected 1 Error

    I keep on getting this error "To few parameters expected 1. Here is my code:

    Dim VendID As String

    VendID = Forms![PCCurrentBidItems]![VendID]

    Dim rcdst As DAO.QueryDef

    Set rcdst = CurrentDb.CreateQueryDef("", "UPDATE PCBulkImportTable SET " & _
    " PCBulkImportTable.[Item Check] = True WHERE VendID=Me.VendID")
    rcdst.Execute

    All I want this to do is the current record that person is on a check box will be marked as True this is in the PCBulkImportTable.

    Any help would be appreciated.

    Thank you

  2. #2
    Join Date
    Sep 2006
    Location
    Surrey, UK
    Posts
    994
    Provided Answers: 2
    I'm fairly sure that you can only use SELECT statements to open recordsets. Consider this instead:
    Code:
    Dim strSQL As String
    
    strSQL = UPDATE PCBulkImportTable SET [Item Check] = True WHERE VendID = " & [Forms]![PCCurrentBidItems]![VendID]
    
    CurrentDb.Execute strSQL
    Also, if possible, I'd advise revising your table design so that column names only contain alphanumeric characters. It makes things easier in the long run.
    10% of magic is knowing something that no-one else does. The rest is misdirection.

  3. #3
    Join Date
    Apr 2012
    Posts
    22

    Thanks

    This works perfectly I can't believe I did that must be staring at the screen to long. I appreciate it!

  4. #4
    Join Date
    Sep 2006
    Location
    Surrey, UK
    Posts
    994
    Provided Answers: 2
    You're welcome!

    Sometimes another pair of eyes makes all the difference
    10% of magic is knowing something that no-one else does. The rest is misdirection.

Posting Permissions

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