Yes there is. There are really two way of using the combobox. If it represents many records you would probably want to filter the data and only represent the matching items (See LCN_SELECTED or NIIN_SELECTED below). If it represents a single item and you want to merely move the focus to that record you would want to use bookmarks (See CPN_SELECTED below).
This code is based on selection from an option box which, in turn, uses the data in the combobox to either filter or find a record.
Steve King
Select Case Me.fraQuickFindType
Case CPN_SELECTED
Set rst = Me.RecordsetClone
rst.FindFirst "[CP/N]='" & Me.cboQFind.Column(0) _
& "' And [Cage]='" & Me.cboQFind.Column(1) & "'"
If rst.NoMatch Then
'
Else
Me.Bookmark = rst.Bookmark
End If 'If rst.NoMatch Then
rst.Close
Case LCN_SELECTED
Me.Filter = "LCN='" & Me.cboQFind & "'"
Me.FilterOn = True
Case NIIN_SELECTED
Me.Filter = "NIIN='" & Me.cboQFind & "'"
Me.FilterOn = True
End Select 'Select Case Me.fraQuickFindType
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.