ordering data in combo box

G

Guest

I am trying to create a combo box to hold classification codes. I want the
user to be able to select the code based on the title, and would like to list
the title column frist, but filling the feild with the code column second.

Because the code field is also a primary key, the combo places the code
field in the first column field no matter what I do.

Is there a way to force the combo to list the title first and the bound
column second?
Thanks
 
J

Jeff Boyce

Jacqueline

What do you want the users to use to select -- the title or the code?

If they select by one, why do you want/need the other to display?

If you want them to select by code, that needs to be your first visible
column. If you want them to select by title, THAT needs to be the first
visible column (even if code was in the first-but-not-visible column).

You could use a text box that gets updated with the value of what isn't
being selected on.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
G

Guest

Open the form in design view, click on menu VIEW - Properties. Click on the
combobox and look at the record source. If it is a SELECT statement then
insert to the end (before the semicolon) the following (edited with your
field name) ORDER BY [YourTitleField]

If it is a query then edit the query for the proper sort.
 
G

Guest

I want the code to go into the field, but users need to see the titles to
select the correct code. What I would like is the ability to move to a title
quicly by typing the first letter of the title; but when a selection is made
I want the code to be the data that is stored in the table.
 
J

Jeff Boyce

Jacqueline

You've just described how a combo box works.

If your "code" is the first field, and is hidden (width = 0), and your title
is your second field (the first visible one), the user will type/select the
title. If your combo box binds to the first field, your table will be
storing the code.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top