Good Morning All!
I have come up with some code here to perform a "search while typing":
Private Sub txtSearchDescription_Change()
Dim SCriteria As String
SCriteria = "(CFTO." & Me!cboSearch & " LIKE '*" & Me!txtSearchDescription.Text & "*')"
Me.Filter = SCriteria
Me.FilterOn = True
Me.txtSearchDescription.SelStart = Len(Me.txtSearchDescription.Text)
If Len(txtSearchDescription) = 0 Or IsNull(txtSearchDescription) = True Then
Me!txtSearchDescription.SetFocus
Me.FilterOn = False
End If
Me!txtSearchDescription.SetFocus
End Sub
cboSearch is a combo box populated by a field list from the "CFTO" table. This "search as you type" code works for about 90% of the fields in the CFTO table. However fields that are dates the code returns a "Run time error 2448" "You can't assign a value to this object."
I'm not to advanced into VBA so this one is giving me trouble and can't figure out what it means..
Thanks for the help,
I have come up with some code here to perform a "search while typing":
Private Sub txtSearchDescription_Change()
Dim SCriteria As String
SCriteria = "(CFTO." & Me!cboSearch & " LIKE '*" & Me!txtSearchDescription.Text & "*')"
Me.Filter = SCriteria
Me.FilterOn = True
Me.txtSearchDescription.SelStart = Len(Me.txtSearchDescription.Text)
If Len(txtSearchDescription) = 0 Or IsNull(txtSearchDescription) = True Then
Me!txtSearchDescription.SetFocus
Me.FilterOn = False
End If
Me!txtSearchDescription.SetFocus
End Sub
cboSearch is a combo box populated by a field list from the "CFTO" table. This "search as you type" code works for about 90% of the fields in the CFTO table. However fields that are dates the code returns a "Run time error 2448" "You can't assign a value to this object."
I'm not to advanced into VBA so this one is giving me trouble and can't figure out what it means..
Thanks for the help,