melanie
A Walking Contradiction
- Local time
- Today, 02:20
- Joined
- Jun 6, 2003
- Messages
- 101
Good day
Please can someone assist me with this combo box issue?
Main form which has a set of two combo boxes. (No 1 is Bank and No 2 is Branch).
Second one relies on the first for its records. (Select Bank first then Select the Branch pertaining to that Bank).
The subform is linked to main form by BankID. BranchId is a where statement on the query feeding the subform.
The subform relies on its records on the selection of first and second combobox...all fine so far, works fine....but I want to be able to view all records based on first combobox (bank) if the bank selected does not have a branch in particular or receives its invoices directly. (Combo2 is Null)
I have found some code on the forum and have played with it, but I am clearly doing something wrong. Below is the code I found:
SELECT State Aid Projects.*
FROM State Aid Projects
WHERE (([County]=Forms!YourFormName!YourComboBoxName Or Forms!YourFormName!YourComboBoxName Is Null)=True)
ORDER BY (whatever order you wanted the data in);The query behind what I described would look something like the above. In this case, if you selected a specific county, the report would return only that county, but if you didn't choose a county (left the combo blank) it would list ALL the counties.
__________________
So, in essence, I'm trying to achieve the above, no record selected in Combo2 (Branch) then give me all the records in my subform pertaining to the Banks, exclude the branch from the equasion.
Any assistance would be gratefully accepted.
Melanie
Please can someone assist me with this combo box issue?
Main form which has a set of two combo boxes. (No 1 is Bank and No 2 is Branch).
Second one relies on the first for its records. (Select Bank first then Select the Branch pertaining to that Bank).
The subform is linked to main form by BankID. BranchId is a where statement on the query feeding the subform.
The subform relies on its records on the selection of first and second combobox...all fine so far, works fine....but I want to be able to view all records based on first combobox (bank) if the bank selected does not have a branch in particular or receives its invoices directly. (Combo2 is Null)
I have found some code on the forum and have played with it, but I am clearly doing something wrong. Below is the code I found:
SELECT State Aid Projects.*
FROM State Aid Projects
WHERE (([County]=Forms!YourFormName!YourComboBoxName Or Forms!YourFormName!YourComboBoxName Is Null)=True)
ORDER BY (whatever order you wanted the data in);The query behind what I described would look something like the above. In this case, if you selected a specific county, the report would return only that county, but if you didn't choose a county (left the combo blank) it would list ALL the counties.
__________________
So, in essence, I'm trying to achieve the above, no record selected in Combo2 (Branch) then give me all the records in my subform pertaining to the Banks, exclude the branch from the equasion.
Any assistance would be gratefully accepted.
Melanie