Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cloning Recordsets in Data Access Pages

Status
Not open for further replies.

Hookstrat

Technical User
Jun 11, 2002
43
US
Hello....
I designed a simple phone directory and data access page for use over a local intranet. I 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 recordeset, 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:

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 &quot;Error: &quot; & err.number & &quot; &quot; & err.description,vbOKOnly
Exit Sub
End If
If (rs.bof) or (rs.eof) Then
Msgbox &quot;No Product found&quot;,,&quot;Search Done&quot;
Exit Sub
End if

I would greatly appreciate any help on this matter and thank anyone in advance for advice they can give. Most appreciatively,
Luke Hoekstra
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top