Re: don't want primary key displayed



John,
Thank you for the examples. I've tried various combinations. It's still
not working.

I want to see both Column 1 and Column 2 in the combo drop-down.
After making a selection,
I want to display Column 2 and store Column 2.

"John Spencer" wrote:

The bound column is the column that will be the value of the combobox. So
if you have two columns, the first column with a non-zero width will be the
one that is displayed, but that has no bearing on the value of the combobox.

Try playing around with the column widths and the bound column setting to
see what happens.

If you want to see column 1 and store column 2 then
Bound = 2
Column Widths should be blank

See column 2 and store column 1
Bound = 1
Column widths = 0

See column 1 and store column 1
Bound =1
Column widths should be blank

See column 1 and store column 1 and not see column 2 (even when you are
selecting from the combobox)
Bound =1
Column widths = ;0



--
John Spencer
Access MVP 2002-2005, 2007
"SusieQ" <SusieQ@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:A086D460-C08C-40CA-817B-D8BA912C21CB@xxxxxxxxxxxxxxxx
Hi John,

Does setting Bound Column=2 mean I need to set Field 1 first in the
RowSource? And if I do that, then won't Field 1 be displayed in the combo
box after making a selection (I need Field 2 displayed)? This is quite
confusing.

"John Spencer" wrote:

Bound Column should be 2 if you want the second column to be stored.

It's tricky since if you use vba to refer to the columns, the column
number
is zero-based. However, the bound column is the one-based instead of
zero-based. I think MS would fix it for consistency's sake, but there is
too large a number of a legacy databases out there that the "fix" would
break.


"SusieQ" <SusieQ@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:EB3838E3-D61C-4B41-9CB6-07042220CD31@xxxxxxxxxxxxxxxx
Rick,
It looks like the problem might stem from the table, which contains two
fields.
Field 1 , primary key, number data type, contains following 10
records:
1
2
3
4
5
6
7
8
9
100
Field 2 is text data type

Both fields need to be displayed in combo box; therefore, can't set
width=0.
Since the leftmost field with ColumnWidth>0 is displayed, I switched
the
fields around in the RowSource property so Field 2 displays first and
set
Bound Column=0 so that Field 2 becomes the stored value.

Problem observed: I select primary key 9 and expect data in
corresponding
Field 2 to display in combo box and become value stored. What I get
instead
is "8" displayed and stored as the value. Would having this combo box
in
a
tab control cause any issues?

"Rick Brandt" wrote:


"SusieQ" <SusieQ@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:CD6A3CAA-79FE-46BF-9A70-27DB16384720@xxxxxxxxxxxxxxxx
Stefan,
how perceptive of you. I do have this table set up as a combo box
in a
form. When I checked how it's writing the record, it's picking up
the
wrong
field even though I have the properties set as:
bound column =1
Column count =2
The form displays only the first field (column 0) even if I enter
Bound
Column=1. All other combo boxes in same form works properly.

The bound column controls which column contains the value of the
ComboBox. It
has nothing to do with the column that is displayed. The column
displayed is
the left-most column with a Column-Width greater than zero.

And Rick is correct that it will display the field in the
ControlSource,
which happens to be storing the primary field. So my problem isn't
the
report, but rather the combo box in my form. What could be causing
this??

Make the width of the first column be zero.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com

.



Relevant Pages

  • Re: Making 2 Tables into 1 Table
    ... All the tables created with Word 2003 display the same ... "Stefan Blom" wrote: ... Microsoft Word MVP ... Note that if you are saying that column widths do not match, ...
    (microsoft.public.word.vba.general)
  • Re: dont want primary key displayed
    ... The bound column is the column that will be the value of the combobox. ... Try playing around with the column widths and the bound column setting to ... If you want to see column 1 and store column 2 then ... Field 2 to display in combo box and become value stored. ...
    (microsoft.public.access.reports)
  • Newbie - resizing datagrid columns programatically
    ... Working on a winform app that will read a table structure and display the ... I want to adjust the column widths to fit ... even though I can see the PreferredColumnWidth property assignment ... Anybody know A) why this is happening?, B) how to fix it, or C) a better way ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: First time flexgrid user
    ... Amazingly I eventually got it to display a recordset... ... or find out how to make the column widths draggable by user... ... Option Explicit ... Dim iCol As Integer ...
    (microsoft.public.vb.general.discussion)
  • Re: How do I populate my combobox - I know...its been asked.
    ... If the Properties window is not displayed in the Visual Basic Editor, ... the View menu to display it. ... Initialize event of the form to populate the combobox. ... I plan on using this script three times but w/ different information ...
    (microsoft.public.word.newusers)