I am creating a Data Form to my database which includes a find form, but whenever I try to use find I get a runtime error 3061 message. This tells me that I have too few parameters and that it expected 1, when I hit Debug it highlights the line datFind.Refresh. Help please
Private Sub Form_Activate()
List1.Enabled = False
datFind.DatabaseName = gDataBaseName
datFind.Refresh
If (datFind.Recordset.RecordCount > 0) Then
Screen.MousePointer = vbHourglass
datFind.Recordset.MoveFirst
While Not datFind.Recordset.EOF
List1.AddItem datFind.Recordset.Fields(0) & ""
datFind.Recordset.MoveNext
Wend
List1.Enabled = True
DoEvents
End If
lblCount = "There are " & datFind.Recordset.RecordCount & " records"
Screen.MousePointer = vbDefault
End Sub
23-09-2004 at 09:50 PM
|
Goran Level: Moderator Registered: 16-05-2002 Posts: 1681
Re: Runtime Error 3061
Check the Recordsource property of data control. you have some parameter in SQL query thay is unknown.
____________________________
If you find the answer helpful, please mark this topic as solved.
24-09-2004 at 05:17 PM
|
gandalf12 Level: Guest
Re: Runtime Error 3061
Yes, I has forgotten to put brackets around a table name with a space in it, the obvious mistakes always seem the hardest to find.