Drop Down box and select statement.

N

Not_a_notes_fan

Hi All

If you can help with this please...

A drop down box, that works ok has the following SQL statement...

SELECT [ID] AS xyz_ID_xyz, [Charity] & ', ' & [Full Name of Charity] & ', '
& [Registered Charity No] AS xyz_DispExpr_xyz, [Charity], [Full Name of
Charity], [Registered Charity No] FROM [Charity Table] ORDER BY [Charity],
[Full Name of Charity], [Registered Charity No];

When the user selects an item from the list, instead of the charity name, it
displays the ID field (numeric value).

The statement was created by the drop down box wizard, so if you could
explain it, or even let me know if there are any bits that do not need to be
in there, it would be really great.

Thanks
 
M

Marshall Barton

Not_a_notes_fan said:
A drop down box, that works ok has the following SQL statement...

SELECT [ID] AS xyz_ID_xyz, [Charity] & ', ' & [Full Name of Charity] & ', '
& [Registered Charity No] AS xyz_DispExpr_xyz, [Charity], [Full Name of
Charity], [Registered Charity No] FROM [Charity Table] ORDER BY [Charity],
[Full Name of Charity], [Registered Charity No];

When the user selects an item from the list, instead of the charity name, it
displays the ID field (numeric value).

The statement was created by the drop down box wizard, so if you could
explain it, or even let me know if there are any bits that do not need to be
in there, it would be really great.


You always have to check what the wizard does to make sure
it's what you really want.

Open the form in design view and double click the combo box
to display its properties sheet. Make sure the BoundColumn
property is the number (probably 1) of the field in the
query that you want to save. Also make sure that the
ColumnCount property is set to the number of fields in the
query (5).

Now, change the ColumnWidths property to the widths that you
want to see when the list drops down (maybe
0";1.5";.6";1.3";0"). The columns with a width of 0 will
not be displayed in the list. The first non-zero column is
the value that will be displayed when the list is not
dropped down.
 
J

Jim Burke in Novi

You just need to change the first value in the 'Column Widths' property of
the control to 0. This means that you don't want the value displayed. After
you select an item from the combobox, the value displayed is the first field
with a non-zero value from the Column Widths property. When you go through
the wizard you can set this value. Typically if you have an ID field (a key)
the wizard will recommend that you hide the field. You can also hide a field
while in the wizard when it shows the 'grid' of the fields in the combobox.
You can drag field widths to make them narrower or wider, and you can drag it
all the way to the left to hide it.
 

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