CoffeeQuick
Programmer
Hi,
I am very new to using Access, i am trying to create my first database using it.
The database is ok, but i am having problems creating a "find button" for the data access page. It should search the first field which is a numerical code.
I have looked at the help files and found vbscript code to add for the onClick event for the find button, but it does not seem to work, and I'm not sure I have setup the button in the right manor (i can't find how i point it to the right field to search).
I get the following error.
Error: 3001 Aguments are of the wrong type, are out of acceptable range, or are in conflict with one another
Here is the vbScript
Not knowing vbScript doesn't help either!!
Can any one help?
Thanks.
John
I am very new to using Access, i am trying to create my first database using it.
The database is ok, but i am having problems creating a "find button" for the data access page. It should search the first field which is a numerical code.
I have looked at the help files and found vbscript code to add for the onClick event for the find button, but it does not seem to work, and I'm not sure I have setup the button in the right manor (i can't find how i point it to the right field to search).
I get the following error.
Error: 3001 Aguments are of the wrong type, are out of acceptable range, or are in conflict with one another
Here is the vbScript
Code:
<SCRIPT language=vbscript event=onclick for=Command1>
<!--
Dim rs
Set rs = MSODSC.DataPages(0).Recordset.Clone
On error resume next
rs.find "Picture Code=" & cLng(inputbox("Enter a picture code","Find"))
If (err.number <> 0) then
Msgbox "Error: " & err.number & " " & err.Description,,"Invalid Search"
Exit Sub
End If
If (rs.box) or (rs.eof) Then
Msgbox "No picture found",,"Search Done"
Exit Sub
End If
MSODSC.DataPages(0).Recordset.Bookmark = rs.Bookmark
-->
</SCRIPT>
Can any one help?
Thanks.
John