Results 1 to 3 of 3
  1. #1
    Thompyt is offline Expert
    Windows 11 Office 365
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    862

    Runtime Error 3061 Too few parameters. Expected 1

    I get the subject error when running the following code at the Red Bold after selecting the Forms Unbound Combobox "Titelz":


    Code:
    Private Sub OpenMyQuery_Click()    Dim RU As DAO.Recordset
        Dim strSQL As String, Title As String, strQuery As String
        Dim RCnt As Integer
        
        strSQL = "SELECT QryROM.* From QryROM WHERE (((QryROM.Titels)=[Forms]![FrmROM]![Titlez]));"
      
        Set RU = CurrentDb.OpenRecordset(strSQL)  
            
    End Sub
    If I run Query1 with the SQL view after selecting the Forms Unbound Combobox "Titelz"
    Code:
    SELECT QryROM.*FROM QryROM
    WHERE (((QryROM.Titels)=[Forms]![FrmROM]![Titlez]));
    the query runs correctly.

    I cannot use this strSQL as a reordset?

  2. #2
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 11 Office 365
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,879
    Assuming titlez is a string

    Code:
    strSQL = "SELECT QryROM.* From QryROM WHERE  QryROM.Titels = """ & [Forms]![FrmROM]![Titlez] & """"
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  3. #3
    Thompyt is offline Expert
    Windows 11 Office 365
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    862
    Thanks moke123. I figured it had something to do with "'s

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 9
    Last Post: 05-29-2023, 01:04 AM
  2. Replies: 3
    Last Post: 04-03-2021, 03:10 PM
  3. Replies: 4
    Last Post: 11-19-2018, 03:26 PM
  4. Runtime Error 3061. Too few parameters, expected 2
    By Gina Maylone in forum Programming
    Replies: 35
    Last Post: 01-13-2014, 02:37 PM
  5. Replies: 1
    Last Post: 05-21-2011, 01:33 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums