Combo Filter

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

Guest

I know this is a stupid but I can't seem to get my records to be filtered by
a numeric value in a combo box. The either no records show or ramdom
un-filtered records show. Can any help with the code for AfterUpdate?
 
I know this is a stupid but I can't seem to get my records to be filtered by
a numeric value in a combo box. The either no records show or ramdom
un-filtered records show. Can any help with the code for AfterUpdate?
show us what you have till now
 
Hi Andi,

I took this advice from a previous note:

On After_Update Combo/List control event write:

Me.FilterOn=False
' If Numeric Field
Me.Filter=[FieldName=" & Me.ComboName
' If text Field
'Me.Filter=[FieldName=" & chr(34) & Me.ComboName & chr(34)
Me.FilterOn=true

But I can't apply it to my form. On my form there's a field called "Depot"
which is a number field (2 digits). I the combo row source relates to a query
which lists all depots. Any ideas?
 
On Tue, 11 Jan 2005 06:11:04 -0800, "JohnC"

if your comboBox name is cboDepot
then go to the Properties--Event

choose the After_update
go to the three points and choose Code Builder
-----start code------------------
Private Sub cboDepot_After_Update

Me.FilterOn=False
Me.Filter="Depot=" & Me.cboDepot

Me.FilterOn=true
end sub
------end code------------

the line Me.Filter="Depot=" & Me.cboDepot means:

set the Form Filter ="the fieldname" = the Value of the combobox
 
Back
Top