I have a form with a combobox "cmb1" and a textbox "txt1". the combobox can be empty or can hold a comparison operator ">" or "<" or "=" without the quotes while the value of the comparison can be entered in the textbox txt1 as shown in the picture below frm1 and I have this query as shown below qry_employee
I tried to pass the value from the combobox as a comparison operator and the textbox value in the criteria in the "emplyee_age" field but I couldn't. for example
I tried for hours but couldn't get it to work. All your help is highly appreciated.
after so many trial and error, I have finally got it to work. It works perfectly. I will post it here for anyone who might search for the same thing :) here is the sql for the query
SELECT tbl_employees.ID, tbl_employees.emplyee_name, tbl_employees.employee_age FROM tbl_employees WHERE (((IIf(IsNull([Forms]![frm1]![cmb1]),True,Eval(([tbl_employees].[employee_age]) & [Forms]![frm1]![cmb1] & [Forms]![frm1]![txt1])))<>False));
Have a great day :)