Combo Box Brain Freeze

G

Guest

I want to put a combo box on a form that will select information from another
table and store only the code from that table. Better described below.

Form - frmSearchName
Uses Table - Summons
Field for Combo Box - Type

The combo box will draw from table tblType which has two fields, TypeCode
and TypeDescr.

My problem is that I want the description (TypeDescr) to display on the
form, but the code (TypeCode) to be stored in the Summons table. Using the
wizard, it bind the field to TypeCode and stores it just fine, but also
displays this info on the form. I know this is simple and that I've probably
done it before .... still looking for an example in one of my other database
..... and drinking my morning coffee!!!!
 
C

Carl Rapson

Sash said:
I want to put a combo box on a form that will select information from
another
table and store only the code from that table. Better described below.

Form - frmSearchName
Uses Table - Summons
Field for Combo Box - Type

The combo box will draw from table tblType which has two fields, TypeCode
and TypeDescr.

My problem is that I want the description (TypeDescr) to display on the
form, but the code (TypeCode) to be stored in the Summons table. Using
the
wizard, it bind the field to TypeCode and stores it just fine, but also
displays this info on the form. I know this is simple and that I've
probably
done it before .... still looking for an example in one of my other
database
.... and drinking my morning coffee!!!!

In your combo box control: set the Bound Column property to 1 and set the
Column Widths property to something like 0";1". This will "hide" the first
column (TypeCode) while leaving it as the bound column, which means it's
that value that gets copied into the bound field (Type).

Carl Rapson
 
G

Guest

Use this ---
SELECT [TypeCode], [TypeCode]& " - " & [TypeDescr] FROM [tblType]
Columns 2
Bound column 1
Column Widths 0"; 2.5"
List Width 2.5"
The second column width and list width to be whatever is necessary to display.
 
R

ruralguy via AccessMonster.com

Setting the ColumnWidth for Column 1 to 0" should do what you want. 0";1"
 
G

Guest

PERFECT and easy. Thanks Carl and Karl!!!

Carl Rapson said:
In your combo box control: set the Bound Column property to 1 and set the
Column Widths property to something like 0";1". This will "hide" the first
column (TypeCode) while leaving it as the bound column, which means it's
that value that gets copied into the bound field (Type).

Carl Rapson
 

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