Combo Boxes

hainejo

Board Regular
Joined
Jun 27, 2002
Messages
57
I am trying to build a form that uses combo boxes to select records. The form has two dropdowns used to select the record. The first on lets the user select the order number and the second one lets the user select the order version number. Each order can have multiple versions or only one version. The combo box that lets the user select the order number works, but I cannot get the combo box for version numbers to populate correctly. How can I populate the version numbers combo box with the available versions based on the the order number selected in the first combo box?
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Hullo. What needs to be done is:
1)Make a query that will give you the version number, with a criteria of the order number. Be sure you are getting the correct information. Once tested, change the criteria to [Form]![frmName]![cboField] where frmName and cboField are appropriate to your situation
2)In the OnChange event for the first combo box, insert a procedure that will run said query.

That should give you what you need.

HTH

P[/list][/list]
 
Upvote 0
Open the Design view of the form. Get to the Properties of the first(trigger) combo-box. On the Event tab, in the OnChange field, select [Event Procedure] and click on the elipisis (...) In the code window that pops up, type
Code:
DoCmd.OpenQuery qryName, , acReadOnly

Remember to change qryName to match your situation. Again, this is off the cuff and UNTESTED, but, should help you along the way.

P
 
Upvote 0

Forum statistics

Threads
1,221,526
Messages
6,160,341
Members
451,638
Latest member
MyFlower

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