From: LilBomShl on
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??
From: ruralguy via AccessMonster.com on
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


LilBomShl wrote:
>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??

--
RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/200911/1

 | 
Pages: 1
Prev: refresh information
Next: Wait Time Report Form