E
Eric
I have the following code attached to a command button on my DAP that I use
to return records in a recordset. The problem is, if the user doesn't type in
the "CompanyName" value exactly as it is in the database, I get an error
saying the company doesn't exist. Is there any way to alter the code in order
to accomplish the same thing as "Like & etc..." in a Parameter query? Any
help would be great.
<SCRIPT language=vbscript event=onclick for=Command0>
<!--
' Clone the recordset
Dim rs
Set rs = MSODSC.DataPages(0).Recordset.Clone
On error resume next
' This is the command line for the search string.
rs.find "CompanyName= '" & Cstr(InputBox("Please enter the company_
information you wish to find", "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 record of company in database",,"Done_ Searching"
Exit Sub
End if
MSODSC.DataPages(0).Recordset.Bookmark = rs.Bookmark
-->
</SCRIPT>
to return records in a recordset. The problem is, if the user doesn't type in
the "CompanyName" value exactly as it is in the database, I get an error
saying the company doesn't exist. Is there any way to alter the code in order
to accomplish the same thing as "Like & etc..." in a Parameter query? Any
help would be great.
<SCRIPT language=vbscript event=onclick for=Command0>
<!--
' Clone the recordset
Dim rs
Set rs = MSODSC.DataPages(0).Recordset.Clone
On error resume next
' This is the command line for the search string.
rs.find "CompanyName= '" & Cstr(InputBox("Please enter the company_
information you wish to find", "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 record of company in database",,"Done_ Searching"
Exit Sub
End if
MSODSC.DataPages(0).Recordset.Bookmark = rs.Bookmark
-->
</SCRIPT>