Results 1 to 2 of 2

Thread: Runtime Error 3061 - Please HELP! (VB5)

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2000
    Posts
    30

    Angry

    I have two forms (SCS,RBSSCS_ACC), and the first one has a command button on it which searchs a Access Database (RBSSCS.mdb) under the table CUSMS (which is the Customer Master file which has three columns). The code is then writeen so that if a match comes up on the search it is shown on a datagrid which is on the other form.

    The code for the command button on the first form (SCS)is:

    ------------------------------------------------------------
    Private Sub acccmd_Click()
    Dim CUSTNAME As String
    Dim CRLF, CRLF2, CRLF6 As String
    CRLF = Chr(13) & Chr(10)
    CRLF2 = CRLF & CRLF
    CRLF6 = CRLF & CRLF & CRLF & CRLF & CRLF & CRLF

    CUSTNAME = InputBox(CRLF6 & "ENTER CUSTOMER NAME" & CRLF & "(FULL OR PARTIAL - 31 CHARS. MAX.)", "CUSTOMER NAME SEARCH", , , 1800)
    If Len(Trim(CUSTNAME)) = 0 Then Exit Sub

    RBSSCS_ACCT.RecordSource = "SELECT * FROM CUSMS Where Name LIKE '" & CUSTNAME & "*'"
    RBSSCS_ACCT.Refresh

    If RBSSCS_ACCT.Recordset.RecordCount = 0 Then
    MsgBox "Sorry, no matching records fond", vbInformation, "Search"
    Else
    Set RBSSCS_ACC.Data1.Recordset = RBSSCS_ACCT.Recordset
    RBSSCS_ACC.Show
    End If

    End Sub
    ------------------------------------------------------------

    Just to let you know:
    RBSSCS_ACCT is the data control for the first form


    When I run the program, I get up to:
    RBSSCS_ACCT.Refresh

    and then I get Runtime Error 3061 saying:
    "Too few parameters - expected 1". This happens whenever I enter a name (with many characters) into the INPUTBox. I know that the name exists in the databases, so I dont know what is wrong. Please HELP!!!

    -Brandr
    [email protected]

  2. #2
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367
    That error usually comes up when you have a database element spelled incorrectly. Check to make sure your SQL is correct, and to make sure you just didn't spell something wrong in the DB.

    Hope this helps

Posting Permissions

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



Click Here to Expand Forum to Full Width