Me.Filter works once then pulls up old results

Gaccesses

Registered User.
Local time
Today, 09:49
Joined
Mar 13, 2012
Messages
40
Hi

I have 3 combo boxes, with filter coding in each after update of each box.

Private Sub ComboBox1_AfterUpdate()

Me.filter = " [Combo1]=" & Me.ComboBox1
Me.filteron= True

Me.ComboBox2=""
Me.ComboBox3=""

Me.ComboBox2.Requery
Me.ComboBox3.Requery

end sub

Private Sub ComboBox2_AfterUpdate()

Me.Filter = "[Combo1]= " & Me.ComboBox1 & " AND [Combo2 ]= ' " & Me.ComboBox2 & "'"

Me.ComboBox3 = ""

Me.ComboBox3.Requery

End sub

and so forth

These programming tools work fine.. ONCE, but when you change the value of ComboBox1 to something else.. the previous filters found in ComboBox2 and ComboBox3 remain the same.. making the filter results inaccurate.

can anyone help?
 
Instead of Me.combobox2.requery try Me.requery. Naturally, you should change it for combox3 also.
 
Also, instead of setting the combo to an empty string ("") do this:

Me.ComboBox3 = Null
 
Actually worked.. I just had to make sure I was accurately referencing all that I needed.
I also had some funky coding somewhere that I forgot was there and erased that. Essentially... the code above resolves the issue.. hope this can help someone in the future.
 

Users who are viewing this thread

Back
Top Bottom