A combo box can show multiple colums (set Format/Column Count to x).
If the Data/Row Source is set directly to a table, then that will display
the first x fields of each record.
If it looks ugly you can change the width of each column by setting
Format/Column Widths to something like 3;1.5;whatever.
By the way, you can set the column width to zero to hide the field value,
but it will still be available - see later.
If the name and telephone number are not the first two fields in the
table, then you have to (a) create a query which picks out only those two
fields and use that as the Row Source, or (b) write an SQL statement in
the Row Source to do the same thing: something like Select [Person Name],
[Telephone Number] from MyRecordset order by [Person Name].
To fill text boxes when someone choses a person from the list you have to
write a bit of code in the combobox Click event.
Something like
txtPersonName = MyCombo
txtTelNo = MyCombo.column( 1)
Note that here the Bound Column of MyCombo must be set to 1, and that is
the same as saying MyCombo.Column( 0) - confusing isn't it?
As I said before, you don't actually have to display the telephone number
field in the combobox; by setting the column widths to something like 1;0,
the second column will be hidden, but the MayCombo.column (1) business will
still find the correct value.
On Tue, 12 Oct 2004 22:48:58 +0200, jvb <no****@nospam. nl> wrote:
Hello,
I have got the following problem.
I have an access database with the name of different persons and there
telephone numbers.
In an access page you can display the field name and the telephone
number.
What i want to do is a combobox in wich you can select the name and the
the
right telephonenumber has to be shown!
I CANT FIGURE IT OUT HOW TO DO THIS. IT LOOKS SIMPLE BUT ........
WHO CAN HELP ME!
THANKS
--
Using Opera's revolutionary e-mail client:
http://www.opera.com/m2/