thundermane
Registered User.
- Local time
- Today, 14:26
- Joined
- Sep 23, 2011
- Messages
- 14
Hi everyone,
Sorry if this was asked before, but all I could find were posts regarding not working comboboxes.
I have two combo boxes on the detail of a subform. Combo1 is a value list, called Type, with 2 columns, Boundcolumn 1, and the list something like "1;Main Service;2;Extra;3;Products".
Combo2 is called Subtype, 3 columns, Boundcolumn 1, and I use a SELECT CASE statement in the After Update event of Combo1 to change the Rowsource of Combo2. Other textboxes and their fields are populated according to the choices made in Combo2.
The majority of the data will be 'Main Service' for Combo1, which essentially has no subtype, meaning Rowsource for Combo2 would be blank with it and its ControlSource field storing the value 0. But for the few cases where Combo1 is 'Extra' and 'Product', Combo2 would store numeric values taken from 2 different tables that I set as Rowsources for each. They're both working, the values are stored and Combo2 shows them correctly upon data entry, but after closing the form and reopening it, Combo2 shows blank whenever Combo1 shows Extra or Product.
I know this is probably because I intentionally left the Rowsource of Combo2 blank when I designed the form. But then I figured I'd set the Rowsource to an IIf statement to get the same effect as the SELECT CASE in the After Update event. It didn't work, it still shows blank.
Then after serious googling, one site I saw had me put the same SELECT CASE statement in the On Current event of the subform. Still didn't work.
Any ideas? I am using Access 2007.
Sorry if this was asked before, but all I could find were posts regarding not working comboboxes.
I have two combo boxes on the detail of a subform. Combo1 is a value list, called Type, with 2 columns, Boundcolumn 1, and the list something like "1;Main Service;2;Extra;3;Products".
Combo2 is called Subtype, 3 columns, Boundcolumn 1, and I use a SELECT CASE statement in the After Update event of Combo1 to change the Rowsource of Combo2. Other textboxes and their fields are populated according to the choices made in Combo2.
The majority of the data will be 'Main Service' for Combo1, which essentially has no subtype, meaning Rowsource for Combo2 would be blank with it and its ControlSource field storing the value 0. But for the few cases where Combo1 is 'Extra' and 'Product', Combo2 would store numeric values taken from 2 different tables that I set as Rowsources for each. They're both working, the values are stored and Combo2 shows them correctly upon data entry, but after closing the form and reopening it, Combo2 shows blank whenever Combo1 shows Extra or Product.
I know this is probably because I intentionally left the Rowsource of Combo2 blank when I designed the form. But then I figured I'd set the Rowsource to an IIf statement to get the same effect as the SELECT CASE in the After Update event. It didn't work, it still shows blank.
Then after serious googling, one site I saw had me put the same SELECT CASE statement in the On Current event of the subform. Still didn't work.
Any ideas? I am using Access 2007.