don't have a result via runnung a code

mana

Registered User.
Local time
Yesterday, 17:08
Joined
Nov 4, 2014
Messages
265
hello,

i wrote the following vba code in a change event oof a combo box but it doesn't work
can you help me please?

Code:
If Me.Combo25.Value = "alle erledigen im jänner" Then
Me.RecordSource = " SELECT * FROM qry_Nacharbeitsmgnt_Reifenfelgenforedit WHERE MONTH(qry_Nacharbeitsmgnt_Reifenfelgenforedit.[erledigt am]) = 1 "
     DoCmd.Requery
End If
 
In simple English, could you please explain what you want to do?
 
I have a combo box and one of its values is "alle erledigen im jänner"
i want when i choose this value all of data from my query wil be shown those have the month of erledigt_am field in januar. "erledigt_am" is a field in my query that is from date type and i want all of th data those have month=1 in this fied.
do you know how?
 
Okay you wan to filter the Form based on a ComboBox selection. In that case the CombobBox needs to be Unbound. The next information you need is a Filter on the Form, simply.
Code:
If Me.Combo25 = "alle erledigen im jänner" Then
    Me.Filter = "Month([erledigt am]) = 1"
    Me.FilterOn = True
End If
 
Last edited:
hello


thank you for the response
when i run this i have the below error:

invalid use of property
in this line: Me.FilterOn
 
Sorry my bad it should be FilterOn = True. I have modified the code. Please have a check again.
 
thank you
i did it but again nothing is done and nothing is changed
i don't know why?
 

Users who are viewing this thread

Back
Top Bottom