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:
I would greatly appreciate any help on this matter and thank anyone in advance for advice they can give. Most appreciatively,
Luke Hoekstra
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 "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
I would greatly appreciate any help on this matter and thank anyone in advance for advice they can give. Most appreciatively,
Luke Hoekstra