combo box

J

JIM WHITAKER

I'm using access 2000 as frontent to mysql with ODBC. A wizard generated
the following code to find a record on a form using a combobox. It works
perfect. However, here's the question, I have no reference to DAO libraies
what so ever. The references are ADO 2.7, OLE automation, microsoft access
9.0, and visual basic for applications. Notice the findfirst in the code,
ADO doesn't have findfirst. Why is this working?
Also notice Me.Recordset.Clone instead of Me.Recordsetclone.

Private Sub Combo14_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[petid] = " & Str(Me![Combo14])
Me.Bookmark = rs.Bookmark
End Sub
 
K

Ken Snell [MVP]

It's working because the Recordset of a form is a DAO recordset. You don't
need the DAO library as a reference in this case because you're not creating
any new DAO objects.
 
J

JIM WHITAKER

Thanks for the fast reply.

Ken Snell said:
It's working because the Recordset of a form is a DAO recordset. You don't
need the DAO library as a reference in this case because you're not creating
any new DAO objects.
--

Ken Snell
<MS ACCESS MVP>




JIM WHITAKER said:
I'm using access 2000 as frontent to mysql with ODBC. A wizard generated
the following code to find a record on a form using a combobox. It works
perfect. However, here's the question, I have no reference to DAO
libraies
what so ever. The references are ADO 2.7, OLE automation, microsoft
access
9.0, and visual basic for applications. Notice the findfirst in the code,
ADO doesn't have findfirst. Why is this working?
Also notice Me.Recordset.Clone instead of Me.Recordsetclone.

Private Sub Combo14_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[petid] = " & Str(Me![Combo14])
Me.Bookmark = rs.Bookmark
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top