2 tables, 1 Combo box

bobzarkoff

New Member
Joined
Jun 20, 2008
Messages
33
I have a field in a form that can either be a number from table A, a number from table b or just "Standard". I've tried to get the combo box to do this but at the moment it's eluding me. Basically I want 1 list that's made up from 2 separate tables. Any ideas other than creating a third table?
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Each number has a unique style so you can tell what type it is by looking at it. Basically it's for an order form, the order can either be ordering stock (standard) or from a customer making a request or from a project that is being worked on. When the order comes in they need to be able to tell what it was for.
 
Upvote 0
My preference in that case is to create different subforms for the separate scenarios, then load the appropriate subform as required. The reason for that is that each option may have different fields, and trying to hide/display the correct fields at run time is not always foolproof.

Option 1: Have all subforms on the main form, toggle visibility
You build each subform with the required fields. Set each one to be exactly the same size, then layer them on top of each other.
When the user selects what they will be doing (Combo box with list options like Order Stock, Customer Request, Existing Project), you set the visibility of the desired form to Yes and the others to No.

Option 2: Load a blank form.
Again, user selects from the combo. At this point you change the Source Form for the blank to whichever form is required.

Option 1 is easier to set up. Option 2 gives better performance.

If instead you want to go with the one subform, combo pulling data from two or more tables, you can use a Union query as the row source for the combo.

Denis
 
Upvote 0
A third option:
Provide a combo box to select one of the three options Order Stock, Customer Request, Existing Project.

Assign a defined name to each of the three number tables.

On selecting the type of option have the Combox change procedure write the associated table defined name to the RowSource property of the combobox to select a number.
 
Upvote 0
Thank guys, figured it out with option buttons instead of the first combo box and then using mouse down on each option to generate row source property.
 
Upvote 0

Forum statistics

Threads
1,213,510
Messages
6,114,037
Members
448,543
Latest member
MartinLarkin

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