Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

combo boxes

ResolvedVersion 2007

Combo Boxes

Hi -

I have a form (based on one table) on which I have added a Combo box in order to quickly select which company is shown on the form. My form is already created and when you open it it automatically defaults the sorting of Company Name by A-Z, which is ideal. When I put my Combo Box in (via the wizard on the form) my list of names in there is not sorted at all and I cannot figure out how to make it default to sort A-Z on Company Names like the form does.

Without the ComboBox being sorted it is as good as useless for a quick selection tool.

Also - is it possible to have a combo box (or another search tool) on a sub-form?

Please help!

Thanks

RE: Combo Boxes

Hello Sarah,

Hope you enjoyed your Microsoft Access courses with BEST Training.
Thank you for your question regarding Combo Boxes.

1.ORDERING COMBO BOX LIST
As the content of a Combo box list is generated by an SQL query, it makes sense that if we modify the query or data source, then the list will also change.

To make this change, switch to the properties window of the combo box, then select the DATA tab.
Under ROW SOURCE, click the three dots (...) at the end of the property to launch the query builder.
Sort the field you want ordered
Close the query, click on YES.
This will update the SQL statement and sort the list.

An alternative is to build the Combo box from scratch by using the TOOLBOX and Wizard. During this process, one of the options is to sort the fields.

2. COMBO BOX IN SUBFORM
Best way to do this is to ensure that the combo box exists at the TABLE level and then it will show through to the form. I suggest you make a copy of your database, test your changes, and once you are confident in makeing the changes then implement to your live database.

Here is an example
Let say you have a Supplier and a Product table.
The Product table will have a field that looks up the Supplier name - should be a Lookup field (in other words, Combo Box!)
Once you have set this up, make a simple form from the Product table. Notice how the Supplier field is a Combo box!
Apply this thinking to your subform, and let me know what you come up with.

I hope this resolves your question. If it has, please mark this question as resolved.

If you require further assistance, please reply to this post. Or perhaps you have another Microsoft Office question?

Have a great day.
Regards,

Richard
Microsoft Office Specialist Trainer

Access tip:

Space marks

It is good practice not i to have space marks for field names as this can lead to problems when using queries or VBA code. It is much better to use an underscore charcter to represent spaces in field names

View all Access hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.09 secs.