Populate subform datasheet combobox from tabcontrol combobox

tstuve

New Member
Joined
Apr 29, 2002
Messages
19
I have a product combobox that is part of a subform datasheet embedded in a tab control on the main form. I would like it to be populated based on a selection from a subcategory combobox that sits on the main form's tab control.

I can't get it to populate correctly, but when you try to add another record in the datasheet, the product list doesn't change. If I change the subcategory selection, the product list is is the same as in the first record.

Any ideas??

Thanks in advance.
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Re: Populate subform datasheet combobox from tabcontrol comb

I'm suspicious that either Requery or Refresh methods will do the trick for you. I believe objects only go out and build their listvalues when they are intially opened (form opened and controls active) - to get new values, you'd have to Requery the record source.

Not sure if you'd have to requery the entire subform or if you could be more specific.

Mike
 
Upvote 0
Re: Populate subform datasheet combobox from tabcontrol comb

Thanks for your reply. I gave up on using a combo on the tab control, and put it in the header of the subform. Then I set the rowsource of the subform combo to load on the "got focus" event and that did the trick.

I thought the requery method should work too, but my syntax probably wasn't set up correctly, in retrospect.
 
Upvote 0

Forum statistics

Threads
1,221,692
Messages
6,161,351
Members
451,697
Latest member
pedroDH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top