T
T Payne
Here's an "easy" question, I'm sure. How do I get a combo box to display a
different value than the field it is bound to?
Thanks
T
different value than the field it is bound to?
Thanks
T
T Payne said:Thanks. Here are the answers to your questions:
RowSource SELECT [PersonID], [Name] FROM [People];
RowSourceType Table/Query
BoundColumn 1
ColumnCount 2
ColumnWidths 0";1.5"
Limit To List yes
(It won't let me set the "Limit To List" to "No" -- which is my problem).
Ken Snell (MVP) said:Post the values of these properties from the combo box:
RowSource
RowSourceType
BoundColumn
ColumnCount
ColumnWidths
If the RowSource is a query name, post the SQL statement of the query. If
the RowSource is a table name, post the field names of the table.
Ken Snell (MVP) said:You cannot set Limit To List to "no" unless the BoundColumn is the first
visible column. The reason is this: The BoundColumn is the value of the
combo box; the other columns are just there for display purposes. Thus, if
you want to enter a new value, and you enter the value that corresponds to
a column that is there just for display purposes, ACCESS has no way of
knowing what the value of the BoundColumn should be for that new entry
because you're not providing it in the combo box.
The way to do what you seek is to pop up a form when a new entry is made
that isn't on the list, and let the user enter the new data into that
popup form, save the data to the table where the data are stored, close
the form, and requery the combo box so that the new data are included in
the combo box's list of info. See this article at The ACCESS Web for info
about this:
http://www.mvps.org/access/forms/frm0015.htm
--
Ken Snell
<MS ACCESS MVP>
T Payne said:Thanks. Here are the answers to your questions:
RowSource SELECT [PersonID], [Name] FROM [People];
RowSourceType Table/Query
BoundColumn 1
ColumnCount 2
ColumnWidths 0";1.5"
Limit To List yes
(It won't let me set the "Limit To List" to "No" -- which is my
problem).
Ken Snell (MVP) said:Post the values of these properties from the combo box:
RowSource
RowSourceType
BoundColumn
ColumnCount
ColumnWidths
If the RowSource is a query name, post the SQL statement of the query.
If the RowSource is a table name, post the field names of the table.
--
Ken Snell
<MS ACCESS MVP>
Thank you. But when I try to do that, Access tells me the visible
column has to be limited to a list. I want a constrained list, but I
need to be able to add values to it. I don't see why that should be a
problem.
Please help.
Thanks.
T
Use the ColumnWidths property. Setting a column to 0 (zero) makes it
invisible. The first visible column is the one that will be displayed
in the combo box when the dropdown list is not open.
--
Ken Snell
<MS ACCESS MVP>
Here's an "easy" question, I'm sure. How do I get a combo box to
display a different value than the field it is bound to?
Thanks
T