Sorting Unbound Combo Box in VBA

Elijahnzl

Registered User.
Local time
Tomorrow, 01:40
Joined
Oct 31, 2012
Messages
19
Hi All

Here is my code that works apart from the fact when a new record is added it gets added at the bottom of the combo box.

How can I sort the combobox please?

Private Sub cboSearch_AfterUpdate()
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[Family_ID] = " & Str(Nz(Me![cboSearch], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark

End Sub
Private Sub cboSearch_GotFocus()
Me.cboSearch.Dropdown
End Sub
Private Sub Form_AfterUpdate()
Me.cboSearch.Requery
End Sub
Private Sub Form_Current()
Me.cboSearch = ""
Me.Family_Name.SetFocus
End Sub

Thanks

Gene
 

Users who are viewing this thread

Back
Top Bottom