How do I reorder the displayed columns in a Combo Box dropdown list??

Lateral

Registered User.
Local time
Yesterday, 19:28
Joined
Aug 28, 2013
Messages
388
Hi guys,

I'm a newbie with Access and I have spent hours trying to figure out how to reorder the displaying of the columns in a Combo Box dripdown list of have in my Access 2007 application.

The columns that are being displayed are (in the current order):

Part Name
Unit Price
Parts.Web_Category

I want the order to be the following:

Parts.Web_Category
Part Name
Unit Price


Thanks very much for any help you can provide.

Regards
Greg
 

Attachments

  • ComboBoxHeadings.JPG
    ComboBoxHeadings.JPG
    69.3 KB · Views: 110
You set the order of the columns in the list box (or combo) recordsource.
Reorder the fields in the recordsource query.
 
Hi Smig

Is this what you are referring to??

SELECT DISTINCTROW Parts.*, Parts.Web_Category, Parts.UnitPrice, Parts.KitID, Parts.DefaultQty, Parts.PartDescription, Parts.Notes FROM Parts ORDER BY Parts.Web_Category, Parts.PartDescription;
 
If the record source is based on a query--which it looks like it is--then I'd just open that query in Design View and drag the appropriate fields into the positions you desire.
 
Hi Reese,

Thanks for the reply.

I can't really see where I go into Design view and simply "drag" the appropriate fields to the desired order....

I have attached a few screen shots...

Thanks again for helping me with this issue.

Regards
Greg
 

Attachments

  • ComboBoxQuery01.jpg
    ComboBoxQuery01.jpg
    93.3 KB · Views: 113
  • ComboBoxQuery.jpg
    ComboBoxQuery.jpg
    101.3 KB · Views: 107
The ComboBoxQuery01 screenshot is what you want. That's the Design View. An easy way to open something in Design is to right-click it and select the Design View option.

If you left-click and hold that thin gray line just above the Field row it will select the column you are clicking above and you can drag it to the left or to the right.

You can also move things around in SQL View, which displays the code that you posted in your second post. To go into that view open the query then right-click it's tab or window and select SQL. You can then move each piece of code in the SELECT statement like you would move text in a text editor. It does the same thing, but frankly it's easier and quicker to do it in Design View, especially if you're new to Access.

I hope that helps.
 
Hi Reese,

That's what I thought and did.

If you have a look at ComboBoxQuery01.jpg you will see that the order of the fields are how I want them, ie:

Web_Category Part Name Unit Price

But when I select the drop down from the Combo Box, I still get:


Part Name Unit Price Web_Category

I've got to be missing something simple....

Regards
Greg
 
Your row source, as first item, has Parts.*, which takes all the fields of the table in the sequence they were defined in the table.
 
What is the "Parts.*" field that is to the left of Web_Category? That may be what is messing things up.

And it seems that spikepl beat me to the punch.
 
Hi Reese,

Thanks for the reply.

I can't really see where I go into Design view and simply "drag" the appropriate fields to the desired order....

I have attached a few screen shots...

Thanks again for helping me with this issue.

Regards
Greg
In design mode DoubleClick or drag a field.
If you do it for the * it will add all fields, in the same order as they are in the table.

You can reorder fields in query by clicking a field and dragging it left or right
 
Hi guys

I tried moving the Parts.* field...the query doesn't work as it should.
I tried deleting the Parts.* field - the query doesn't work as it should

Any other ideas?
 
Unfortunately, without fiddling around with it myself, I can't really think of anything. And at that point I'd just be playing around with no real idea what I was doing.
 
Hi Reese

I decided to create another Combo Box using the Wizard to see if if it allowed me to order the columns the way I wanted and it did!

Problem solved....

Thanks for your help with this.

Regards
Greg
 
I'm glad you were able to solve it. And it was a good, simple solution.
 

Users who are viewing this thread

Back
Top Bottom