Combo box to find a record in Access 2007

L

LilBomShl

I have a combo box created to find a specific record on a Main form. I've
created many of these in 2003 using my combo box wizard with no problems, but
I can't seem to get one to work in 2007. I used to use an event procedure in
my After Update such as
Private Sub FINDAQUOTE_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[strQuotationNumber] = '" & Me![FINDAQUOTE] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

But it doesn't work in my 2007 form
Has the code changed in 2007 or is there another way to do it??
 
R

ruralguy via AccessMonster.com

If it helps, Me.Recordset.Clone is a METHOD of an ADO Recordset and not an
object. The default Library in ac2003 was ADO but it is DAO in ac2007.

Try:
Private Sub FINDAQUOTE_AfterUpdate()
DoCmd.Requery ' Get any changes to the table first.
' Find the record that matches the control.
Me.RecordsetClone.FindFirst "[strQuotationNumber] = '" & Me![FINDAQUOTE] &
"'"
If Not Me.RecordsetClone.NoMatch Then
Me.Bookmark = Me.RecordsetClone.Bookmark
End If
End Sub

I have a combo box created to find a specific record on a Main form. I've
created many of these in 2003 using my combo box wizard with no problems, but
I can't seem to get one to work in 2007. I used to use an event procedure in
my After Update such as
Private Sub FINDAQUOTE_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[strQuotationNumber] = '" & Me![FINDAQUOTE] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

But it doesn't work in my 2007 form
Has the code changed in 2007 or is there another way to do it??
 

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