Bean Machine
Member
- Local time
- Today, 12:55
- Joined
- Feb 6, 2020
- Messages
- 102
I have been working on a database used by staff to record loans taken out by students. I have a combobox that has the usernames of the students. I would like to make it possible for staff members to locate a username by entering the name into a textbox. I want it to filter to an exact students username, for example if a students username is gregdan I wouldn't want someone to be able to filter for just greg. I have looked everywhere for a solution but I can't seem to find one. Here is what I have come up with:
Private Sub txt_Filter_KeyUp(KeyCode As Integer, Shift As Integer)
If Me.txt_Filter = Me.cbx_Username Then
Me.Form.Filter = "[Items_In_and_Out] = " & Me.txt_Filter
Me.FilterOn = True
Else
MsgBox "Error"
End If
End Sub
Any help would be absolutely amazing and thanks in advance.
(txt_Filter is the textbox name and cbx_Username is the name of the combobox I am trying to filter)
Private Sub txt_Filter_KeyUp(KeyCode As Integer, Shift As Integer)
If Me.txt_Filter = Me.cbx_Username Then
Me.Form.Filter = "[Items_In_and_Out] = " & Me.txt_Filter
Me.FilterOn = True
Else
MsgBox "Error"
End If
End Sub
Any help would be absolutely amazing and thanks in advance.
(txt_Filter is the textbox name and cbx_Username is the name of the combobox I am trying to filter)