PDA

Click to See Complete Forum and Search --> : Runtime Error 3061 - Please HELP! (VB5)


Brandr
Jul 10th, 2000, 12:14 PM
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
bbeekman@rbscorp.com

Negative0
Jul 10th, 2000, 02:51 PM
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