Cannot get NAME of field, just ID (autonumber) for FORM/REPORT

G

Guest

I created a form and cannot get the NAME of the field item to list in the
drop down (combo box) for me, it keeps giving me the ID (autonumber).

I am new to Access, so when I go to the control source and CATEGORYID is
listed I've tried to go into the 3 dots, but I've tried double clicking so
many different combinations I don't know what I am doing. I have a CATEGORY
table set up that autonumbered 1-7 and then I typed in a NAME field with 7
names. I want the NAMES to show in the drop down list, not the number.

Please explain, in detail, how I change the properties. I have TABLE/QUERY
selected also.
 
S

Steve Schapel

Smags,

Set the Category table as the Row Source of the combobox. In the
Propwerties of the combobox, set the Column Count to 2, and Column
Widths to 0;x where x is whatever size you need in order to display the
category name adequately, and the List Width also probably needs to be
set to x. This will show the Names and not the ID. However, if the
Bound Column property ofd the combobox is set to 1, the actual value of
the combobox will still be the ID.

By the way, as an aside, 'name' is a Reserved Word (i.e. has a special
meaning) in Access, and as such should not be used as the name of a
field or control.
 
J

John Vinson

I created a form and cannot get the NAME of the field item to list in the
drop down (combo box) for me, it keeps giving me the ID (autonumber).

I am new to Access, so when I go to the control source and CATEGORYID is
listed I've tried to go into the 3 dots, but I've tried double clicking so
many different combinations I don't know what I am doing. I have a CATEGORY
table set up that autonumbered 1-7 and then I typed in a NAME field with 7
names. I want the NAMES to show in the drop down list, not the number.

Please explain, in detail, how I change the properties. I have TABLE/QUERY
selected also.

Some of these may be already set this way, and I don't know your
tablenames so adapt them to this:

1. Click the ... icon by the RowSource property, accept Access' offer
to open the query design window, and select both the CATEGORYID and
NAME fields (note: NAME is a reserved word, since every object has a
Name property; you might want to change this to Category).
2. Sort Ascending by NAME (or Category if you rename it of course)
3. Close the query window and accept Access' offer to save
4. Set the Column Count property of the combo to 2 (so both the
CategoryID and Category fields will be included)
5. Set the Bound Column to 1 (so that the ID will be saved in your
table, I'm presuming that's what you want stored)
6. Set the Control Source to the name of the field into which you wish
to store the ID
7. Set the Column Widths property to

0;1

to set the width of the ID column to 0 - making it invisible - and of
the Category column to one inch (or any other reasonable size)

John W. Vinson[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