King Kreglo
Registered User.
- Local time
- Yesterday, 20:40
- Joined
- Aug 31, 2013
- Messages
- 32
Hi there!
I'm having some trouble with this code and can't seem to find the solution online.
I have a combo box (cboCurrentCustomer) on my main form that I wish to filter 3 subforms. The combo box serves as a search box, filtering the subforms as you type. The first subfrom I'm testing this on is called "subfrmOrder Central - Access.
The error that keeps coming up is reads "Compile error: Method or data member not found"
Here's the Code I've been trying to use:
This only filters one of the subforms. I figured it'd be best to start with one then whip out the other two!
Any help is appreciated
I'm having some trouble with this code and can't seem to find the solution online.
I have a combo box (cboCurrentCustomer) on my main form that I wish to filter 3 subforms. The combo box serves as a search box, filtering the subforms as you type. The first subfrom I'm testing this on is called "subfrmOrder Central - Access.
The error that keeps coming up is reads "Compile error: Method or data member not found"
Here's the Code I've been trying to use:
Code:
Private Sub cboCurrentCustomer_Change()
' If the combo box is cleared, clear the form filter.
If Nz(Me.cboCurrentCustomer.Text) = "" Then
subfrmOrder Central - Access.Form.Filter = ""
subfrmOrder Central - Access.FilterOn = False
' If a combo box item is selected, filter for an exact match.
' Use the ListIndex property to check if the value is an item in the list.
ElseIf Me.cboCurrentCustomer.ListIndex <> -1 Then
subfrmOrder Central - Access.Form.Filter = "[Customer] = '" & _
Replace(Me.cboCurrentCustomer.Text, "'", "''") & "'"
subfrmOrder Central - Access.FilterOn = True
' If a partial value is typed, filter for a partial company name match.
Else
subfrmOrder Central - Access.Form.Filter = "[Customer] Like '*" & _
Replace(Me.cboCurrentCustomer.Text, "'", "''") & "*'"
subfrmOrder Central - Access.FilterOn = True
End If
' Move the cursor to the end of the combo box.
Me.cboCurrentCustomer.SetFocus
Me.cboCurrentCustomer.SelStart = Len(Me.cboCurrentCustomer.Text)
End Sub
This only filters one of the subforms. I figured it'd be best to start with one then whip out the other two!
Any help is appreciated