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!

Adding Custom filtering to Data Access Page-Error 3265:Item can't be f

Status
Not open for further replies.

Hookstrat

Technical User
Jun 11, 2002
43
US
Greetings
I recently received an internship for a small business firm doing, among other things,design and programming for a 650 entry contact list. First, I designed a simple phone directory and data access page for use over the local intranet. The top of the data access page puts everyone into categories based on job description such as builder, developer, etc. However, users still find it tedious to have to browse through that many entries if they already know who they want to contact. So, 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 didplayed. 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 &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