pdvsa
asked on
Filter a form
Experts,
I need to filter a form (split form, data sheet bottom).
cboFilter is unbound
cboPhase is a Value LIst with row source: "R1";"R2" bound column 1
The below is not correct.
Do you see the issue?
thank you
I had this question after viewing Filter cbo on datasheet -.
I need to filter a form (split form, data sheet bottom).
cboFilter is unbound
cboPhase is a Value LIst with row source: "R1";"R2" bound column 1
The below is not correct.
Do you see the issue?
Private Sub cboFilter_AfterUpdate()
If Me.cboFilter & "" = "" Then
Me.Filter = ""
Me.FilterOn = False
Else
Me.Filter = "[cboPhase] = " & Me.cboFilter
Me.FilterOn = True
End If
End Sub
thank you
I had this question after viewing Filter cbo on datasheet -.
ASKER
Hi Gustav,
OK I made the change for text as instructed.
I get this msg box appearing after I enter for example R1 in the unbound cboFilter
I am not sure why I would be getting a msgbox asking for data?
OK I made the change for text as instructed.
I get this msg box appearing after I enter for example R1 in the unbound cboFilter
I am not sure why I would be getting a msgbox asking for data?
ASKER
I see you made a change to code in other areas.
I don't get a msgbox.
hang on let me test.
I don't get a msgbox.
hang on let me test.
ASKER
It doesn't seem to filter for what I put in the unbound cboFilter. (R1 for example)
It does say "filtered" at the bottom of the form but all records appear.
the cboPhase is value list
It does say "filtered" at the bottom of the form but all records appear.
the cboPhase is value list
ASKER
Gustav: have to run for a bit. will check in after a while.
Put in a line to display your filter value:
Private Sub cboFilter_AfterUpdate()
If Nz(Me.cboFilter) = "" Then
Me.Filter = ""
Me.FilterOn = False
Else
MsgBox "Filter: " & "[cboPhase] = '" & Me.cboFilter & "'"
Me.Filter = "[cboPhase] = '" & Me.cboFilter & "'"
Me.FilterOn = True
End If
End Sub
/gustav
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Rey, that's exactly what my problem was. I was using the name of the field and not the control source.
thanks guys....
thanks guys....
Open in new window
/gustav