If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Combo box to find a record in Access 2007
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?? |
#2
|
|||
|
|||
Combo box to find a record in Access 2007
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/For...forms/200911/1 |
Thread Tools | |
Display Modes | |
|
|