I have a listbox that I'm trying to get to highlight (select) a specific record using the GotFocus event (the listbox setfocus is passed by a combobox afterupdate event).
The code I have is:
Expand|Select|Wrap|Line Numbers
- Private Sub lstRate_GotFocus()
- Dim rs As DAO.Recordset
- Dim SelDate As Date
- 'Dim MyVarBM As Long
- SelDate = DMax("[DateChange]", "tblDate")
- Set rs = Me.lstRate.Recordset
- With rs
- .MoveLast
- .FindFirst "[DateChange] = #" & SelDate & "#"
- If .NoMatch Then
- MsgBox "No Match Found"
- End If
- End With
- End Sub
The code executes fine, the list box recieves the focus, .nomatch is set to false, the variables populate as desired... However the desired record is not highlighted in the listbox!
Anyone able to help me here??
Thanks in advance!
Regards,
Scott