Combo box populates 2 fields

  • Thread starter Charles G via AccessMonster.com
  • Start date
C

Charles G via AccessMonster.com

First of all, I read the article here:
http://www.mvps.org/access/forms/frm0058.htm, but to no avail.

I have a combo box created by the wizard where I enter the the values I want
to appear in the drop down list. My table has [TellerFirst] and [TellerLast].
The combo box with be a list of about 35 bank tellers.

I want to see "Jane Doe" in my combo box labeled [Name]
I want it to then shoot Jane off into my table field [TellerFirst] and Doe
into [TellerLast].

Again, I do not have these values stored in another table, but I chose to
enter the values I wanted listed from the combo box wizard.

-Charles-
 
D

Douglas J Steele

Are you saying that your combo box displays two columns (the first name and
the last name, in that order)?

In the combobox's AfterUpdate event, put code like:

Me![TellerFirst] = Me![Name].Column(0)
Me![TellerLast] = Me![Name].Column(1)


FWIW, you may want to rename your combobox from Name: that's a reserved word
in Access, and using it for your own purposes can sometimes lead to
problems.
 
C

Charles G via AccessMonster.com

tblTellerAward first 3 fields:
[ID] primary key
[TellerFirst]
[TellerLast]
[Date]
etc...

frmTellerAward:
Combo Box [Teller Name] with a drop down list of 35 tellers' first and last
name all in one column. I do not have a field named [Teller Name] and when
the wizard asks me where I want to store it I use Control Source [TellerFirst]
.. I'm not sure if this is right. I just need the first part of the name in
the field [TellerFirst] and the last part in [TellerLast]

-Charles-
 
J

John Vinson

tblTellerAward first 3 fields:
[ID] primary key
[TellerFirst]
[TellerLast]
[Date]
etc...

frmTellerAward:
Combo Box [Teller Name] with a drop down list of 35 tellers' first and last
name all in one column. I do not have a field named [Teller Name] and when
the wizard asks me where I want to store it I use Control Source [TellerFirst]
. I'm not sure if this is right. I just need the first part of the name in
the field [TellerFirst] and the last part in [TellerLast]

-Charles-

If you're copying the teller first and last names from one table to
another - You Are Off The Track.

The teller's name should be stored *once* and only once, in a table of
Tellers or of Personnel. Your combo box should be storing the unique
PersonID (the Primary Key of this table) into your form's recordsource
table, which should not contain any name fields.

John W. Vinson[MVP]
 
C

Charles G via AccessMonster.com

If you're copying the teller first and last names from one table to
another - You Are Off The Track. I'm not.

The teller's name should be stored *once* and only once, in a table of
Tellers or of Personnel. Your combo box should be storing the unique
PersonID (the Primary Key of this table) into your form's recordsource
table, which should not contain any name fields.

I'll create a table with all the tellers instead of adding the values via the
wizard.

-Charles-
 

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