D
Dr. Mohamed Selima
I need to make a button based on If ,, else condition
the form has two unbund fields Combo0 and combo2
if combo 2 = null then the form addressbook will be opened using a filter
its SQL is
SELECT AddressBook.*
FROM AddressBook
WHERE (((AddressBook.Category)=[Forms]![Form1]![Combo0]));
else if combo2 is not null it will open the same form but with this filter
SELECT AddressBook.*
FROM AddressBook
WHERE (((AddressBook.Department)=[Forms]![Form1]![Combo2]) AND
((AddressBook.Category)=[Forms]![Form1]![Combo0]));
How can I put this as VB code
I appreciate your help
the form has two unbund fields Combo0 and combo2
if combo 2 = null then the form addressbook will be opened using a filter
its SQL is
SELECT AddressBook.*
FROM AddressBook
WHERE (((AddressBook.Category)=[Forms]![Form1]![Combo0]));
else if combo2 is not null it will open the same form but with this filter
SELECT AddressBook.*
FROM AddressBook
WHERE (((AddressBook.Department)=[Forms]![Form1]![Combo2]) AND
((AddressBook.Category)=[Forms]![Form1]![Combo0]));
How can I put this as VB code
I appreciate your help