PC Review


Reply
Thread Tools Rate Thread

Combo Box and Two Fields

 
 
=?Utf-8?B?cmFwNDM=?=
Guest
Posts: n/a
 
      7th Jul 2007
To add a new record in a form, I am using a combo box to load a table from
another table. The table I am loading to has two fields that I’d like to load
with one combo box. I like to choose two fields in the combo box and load
both fields in the record I am creating.
 
Reply With Quote
 
 
 
 
Bob Quintal
Guest
Posts: n/a
 
      7th Jul 2007
=?Utf-8?B?cmFwNDM=?= <(E-Mail Removed)> wrote in
news:525BB8B4-7D99-4CC6-9A45-(E-Mail Removed):

> To add a new record in a form, I am using a combo box to load
> a table from another table. The table I am loading to has two
> fields that I’d like to load with one combo box. I like to
> choose two fields in the combo box and load both fields in the
> record I am creating.
>

Give the combobox rowsource as many additional fields as you
want.Bind the controlsource of the combobox to the first column of
the table.
Make the control source of the additional fields =combobox.column
(n) where n is the zero-based index into the columns of the
combobox. This will show them on the form, but will not store the
additional columns in the table. They should not be stored
anyways, they should always be lookedup when you need them in a
form or report.


--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

 
Reply With Quote
 
Joel
Guest
Posts: n/a
 
      7th Jul 2007
rap43 wrote:
> To add a new record in a form, I am using a combo box to load a table from
> another table. The table I am loading to has two fields that I’d like to load
> with one combo box. I like to choose two fields in the combo box and load
> both fields in the record I am creating.

You select a row in a combobox ... thus selecting a row does select both
of your fields. The bound column is the default value returned from the
combobox and can be refenced directly by just the combobox name. You
reference the fields of the selected row by referencing their column
(which is zero based). YourComboboxName.Column(0) refernces the 1st
column. YourComboboxName.Column(1) references the 2nd column.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Parameter queries using forms with combo boxes, with select all, and defaulting combo boxes to blank fields nmoakeh@byte-x-byte.com Microsoft Access 12 15th Oct 2006 07:35 PM
fields in combo box Bird Microsoft Access 2 27th Jun 2006 10:32 PM
Calculating fields in a form from combo fields Jay Microsoft Access 2 19th Jan 2006 08:11 PM
Combo box with two fields hcj Microsoft Access 0 21st May 2004 07:51 PM
Combo box fields Brian C Microsoft Access Forms 1 27th Apr 2004 06:56 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:43 PM.