Combobox filter

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Help me with my combo box filter please,
I have read all of the posts within this group and I cannot figure this one
out. I know it's a simple fix.

Private Sub cmbfilter_AfterUpdate()
Me.Filter = "status = " & Me.cmbfilter
Me.cmbstatus.Requery
Me.FilterOn = True

End Sub


Thanks in advance,
Bob W.
 
Help me with my combo box filter please,
I have read all of the posts within this group and I cannot figure this one
out. I know it's a simple fix.

Private Sub cmbfilter_AfterUpdate()
Me.Filter = "status = " & Me.cmbfilter
Me.cmbstatus.Requery
Me.FilterOn = True

End Sub

Thanks in advance,
Bob W.

It would have been nice had you also posted what problem you are
having.

This works for me in the combo's AfterUpdate event, to filter the
form's records according to the selection of the combo box.
It assumes the bound column of the combo box is a Number datatype.

Me.Filter = "SomeField = " & Me.ComboBox
Me.FilterOn = true

If the bound column is text then use:
Me.Filter = "SomeField = '" & Me.ComboBox & "'"

Now if it doesn't work for you, how about letting us know what you are
trying to do, the datatype of the combo bound column, and what does
happen.
 
I not sure as I have had a similar problem but you could try this:

Private Sub cmbfilter_AfterUpdate()
Me.Filter = "[status] = " & Me.cmbfilter & "
Me.cmbstatus.Requery
Me.FilterOn = True

Sorry if it doesn't help.
 
Back
Top