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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert FindIt recordset from DAO to ADO

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0

Convert FindIt recordset from DAO to ADO

i want to convert from DAO to ADO the

following code:

Private Sub CboCompany_AfterUpdate()
Dim rs As Recordset
Set rs = Me.RecordsetClone
rs.FindFirst "[ClientID] = " &

CboCompany.Value
If rs.NoMatch Then
MsgBox "Client Not Found"
Else
Me.Bookmark = rs.Bookmark

End If
End Sub
Can somebody help me?


 
From what I know about ADO, there is no longer .findfirst. Additionally, you can't specify multiple fields in the .find statement. Also there is no longer a .nomatch. Your code would end up looking like this:

Private Sub CboCompany_AfterUpdate()
Dim rs As adodb.Recordset
Set rs = Me.RecordsetClone
rs.Find "[ClientID] = " & CboCompany.Value

If rs.eof Then
MsgBox "Client Not Found"
Else
Me.Bookmark = rs.Bookmark

End If
End Sub

Remember to set your references to ADO instead of DAO.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top