Hello....
I designed a simple phone directory and data access page for use over a local intranet. I am trying to put in custom filter/find buttons to search the directory by either company name or by last name. I was able to use a tutorial book and some Microsoft based help to insert the command buttons, clone the recordset, execute the find command and message box, and finally to write some custom error handling. However I have limited visual basic experience, so I was disappointed when I continued receiving "Error 3265: Item cannot be found in the collection corresponding to the requested name or ordinal". The message boxes, buttons, and error message boxes are displayed fine but no matter what is put in the input box, the same error is displayed. After some debugging to rule out as much as I could, I think the problem lies in either my attempt to clone the recordset, or my attempt to execute the find command. As you can imagine I was even more dissapointed to discover that the book I purchased only has one paragraph and zero examples dedicated to cloning a recordset.
Here is the code I am using:
I designed a simple phone directory and data access page for use over a local intranet. I am trying to put in custom filter/find buttons to search the directory by either company name or by last name. I was able to use a tutorial book and some Microsoft based help to insert the command buttons, clone the recordset, execute the find command and message box, and finally to write some custom error handling. However I have limited visual basic experience, so I was disappointed when I continued receiving "Error 3265: Item cannot be found in the collection corresponding to the requested name or ordinal". The message boxes, buttons, and error message boxes are displayed fine but no matter what is put in the input box, the same error is displayed. After some debugging to rule out as much as I could, I think the problem lies in either my attempt to clone the recordset, or my attempt to execute the find command. As you can imagine I was even more dissapointed to discover that the book I purchased only has one paragraph and zero examples dedicated to cloning a recordset.
Here is the code I am using:
Code:
Dim rs
Set rs = MSODSC.Datapages(0).Recordset.Clone 'how do I know what to put inside the ()?'
On error resume next
rs.find "Company = '" & CStr(InputBox("Please enter company to find","Find"))& "'"'
If (err.number <> 0) Then
Msgbox "Error: " & err.number & " " & err.description,vbOKOnly
Exit Sub
End If
If (rs.bof) or (rs.eof) Then
Msgbox "No Product found",,"Search Done"
Exit Sub
End if
[\code]
I would greatly appreciate any help on this matter and thank anyone in advance for advice they can give. I posted this about a week ago and got no response. Most appreciatively,
Luke Hoekstra