Joe Was
MrExcel MVP
- Joined
- Feb 19, 2002
- Messages
- 7,539
User form shows current record or selected record form ListBox kyed to the column record source field [Word]. A form button runs the code below: Which gets a word or part of a word from a InputBox and displays the first record like it and also makes it the first record in the list box. If it worked right?
This code returns an error "You can't assign a value to this object." somewhere below the InPutBox?
Private Sub AShowBut_Click()
'Show filtered records starting with ? in a form's [LookUpDef_Form] FieldBox's and
'a ListBox containing the table's [LookUpDef_Table] sorted column [Word] records.
Dim strFilter As String
On Error GoTo Err_AShowBut_Click
strFilter = InputBox("Go to your entered ""Word"" below:")
strFilter = strFilter + "*"
'MsgBox strFilter
Me.Filter = "([Word], strFilter, True, vbTextCompare)"
Me.FilterOn = True
Me.Filter = "strFilter"
Me.FilterOn = True
Exit_AShowBut_Click:
Exit Sub
Err_AShowBut_Click:
MsgBox Err.Description
Resume Exit_AShowBut_Click
End Sub
This code returns an error "You can't assign a value to this object." somewhere below the InPutBox?
Private Sub AShowBut_Click()
'Show filtered records starting with ? in a form's [LookUpDef_Form] FieldBox's and
'a ListBox containing the table's [LookUpDef_Table] sorted column [Word] records.
Dim strFilter As String
On Error GoTo Err_AShowBut_Click
strFilter = InputBox("Go to your entered ""Word"" below:")
strFilter = strFilter + "*"
'MsgBox strFilter
Me.Filter = "([Word], strFilter, True, vbTextCompare)"
Me.FilterOn = True
Me.Filter = "strFilter"
Me.FilterOn = True
Exit_AShowBut_Click:
Exit Sub
Err_AShowBut_Click:
MsgBox Err.Description
Resume Exit_AShowBut_Click
End Sub