I hit a stumbling block.

I am working on a ancestral research type database and I want to link different records together. Here is my scenario so far:

datPrimaryRS is an adoc that is pointing to the Person table.

datNameSourceRS is also pointing to the Person Table. This is used to populate the list in the DBCombo. Now when I double click on the DB Combo I want to move the recordset to the record that matches the boundtext property in the DBCombo. This works fine except when the recordset is sitting at the first or last record in the recordset. In those two cases, the process I designed is broken, it either results in an "unknown error" or it returns back to where it was.

Does anyone have a good example on how to do this?

The method I was using was: ado.recordset.find("[Criteria]=" & DBCombo.boundtext ]).

I surely would appreciate a clue in why this is failing.

Recommended Answers

All 3 Replies

Here's a quote directly from MSDN regarding the Find method of an ADO recordset:

Optional. A SearchDirectionEnum value that specifies whether the search should begin on the current row or the next available row in the direction of the search. An unsuccessful search stops at the end of the Recordset if the value is adSearchForward. An unsuccessful search stops at the start of the Recordset if the value is adSearchBackward.

So, before you execute a search execute the MoveFirst method on the RS. Then after the search check if the RS is at the EOF (ie RS.EOF=TRUE) to see if you found something.

Here's a quote directly from MSDN regarding the Find method of an ADO recordset:

So, before you execute a search execute the MoveFirst method on the RS. Then after the search check if the RS is at the EOF (ie RS.EOF=TRUE) to see if you found something.

Thanks, I figured out that issue shortly after I made the inquiry. I was just puzzled however, why it would behave like it was only on the first and last records. I did have the move first in the code. Whatever was causing it I never figured it out. Before, it would find the records between the first and last but not those two. However, whatever I did to kill the issue, works just fine so I have made huge progress on my database. I was never able to replicate the problem once I played with the code so I am just happy it works now. ;)

Can you plese have the whole code snippet of the find statement posted!.. plss just kindly post it coz really i am having the same problem on the find method!... please share your ideas!..


and also if anyone who knows how to show the database on a datagrid can you kindly help!,, please... coz i didnt quite catch the concept of it!.. that is why i am having problems.. i need to see the code to understand the flow!.. thankss...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.