A
Arnie583
I have been trying to create a keyword vbsearch executed by a command button
in a data access page for one field of my database (DESCRIPTION), the script
I have been using is as follows:
<SCRIPT language=vbscript event=onclick for=Command0>
<!--
'Clone the recordset.
Dim rs
Set rs = MSODSC.DataPages(0).Recordset.Clone
On error resume next
-->
rs.find "Description Like '%" & CStr(InputBox("Enter a Key Word","Find")) &
"%"
'Custom error handling.
If (err.number<>0) Then
Msgbox "Error: " & err.number & "" & err.description,,"Invalid Search"
Exit Sub
End If
'Check search results for success.
If (rs.bof) or (rs.eof) Then
Msgbox "No Product found",,"Search Done"
Exit Sub
End If
MSODSC.DataPages(0).Recordset.Bookmark = rs.Bookmark
-->
The search box appears fine, but whenever a search is attempted the "error
3001" appears signaling some form of invalid argument, the error also appears
without any search data entered if the "Enter" key is pressed. I am using
Access 2003, if someone would need the full copy of the database I could send
it.
Thanks in advance for any help
in a data access page for one field of my database (DESCRIPTION), the script
I have been using is as follows:
<SCRIPT language=vbscript event=onclick for=Command0>
<!--
'Clone the recordset.
Dim rs
Set rs = MSODSC.DataPages(0).Recordset.Clone
On error resume next
-->
rs.find "Description Like '%" & CStr(InputBox("Enter a Key Word","Find")) &
"%"
'Custom error handling.
If (err.number<>0) Then
Msgbox "Error: " & err.number & "" & err.description,,"Invalid Search"
Exit Sub
End If
'Check search results for success.
If (rs.bof) or (rs.eof) Then
Msgbox "No Product found",,"Search Done"
Exit Sub
End If
MSODSC.DataPages(0).Recordset.Bookmark = rs.Bookmark
-->
The search box appears fine, but whenever a search is attempted the "error
3001" appears signaling some form of invalid argument, the error also appears
without any search data entered if the "Enter" key is pressed. I am using
Access 2003, if someone would need the full copy of the database I could send
it.
Thanks in advance for any help