Populate 2 fields from another field.

G

Guest

Ok here goes, I'm trying to populate the fields 'Name' and 'Store' based on
the field 'Emplid'. These all relate to the table 'Callers' and are adding
records to a table 'Call Log' (also multiple other fields fill the form
'Calls')

What I would like is to be able to enter the 'Emplid' of the caller and have
it populate the 'Name' and 'Store' fields. I have the 'Emplid' field set as a
combo box from the 'callers' table already.

Thanks for any help that you can give I’m very appreciative of the fact you
all are so helpful.
 
A

Al Camp

Tim,
Add two more columns to your combo by including the Name and Store in the query behind
it. Set ColumnCount to 3, and appropriate ColumnWidths and List Width. ID in 1st col,
Name in 2nd, Store in the 3rd.
Since you are capturing EmpID, the key field, it's not necessary to "capture" the Name
and Store values, but rather just "display" them to assist the user. Never save a value
that can be derived from a value (EmpID) whenever necessary.
The Name field ControlSource...
= cboYourEmpIDCombo.Coumn(1)
The Store field...
= cboYourEmpIDCombo.Coumn(2)

(columns in a combo are numbered left to right, 0, 1, , 2, etc..)
 
G

Guest

Ok so my row source on the Emplid field is
SELECT Callers.Emplid, Callers.Name, Callers.Store FROM Callers;

What would I set the ControlSource to
= cboSELECT Callers.Emplid, Callers.Name, Callers.Store FROM Callers;.Coumn(1)
or what.

Also is this going to save it in the Call Log table. or will it only be
viewable one kinda thing.
--
Thanks
TimM


Al Camp said:
Tim,
Add two more columns to your combo by including the Name and Store in the query behind
it. Set ColumnCount to 3, and appropriate ColumnWidths and List Width. ID in 1st col,
Name in 2nd, Store in the 3rd.
Since you are capturing EmpID, the key field, it's not necessary to "capture" the Name
and Store values, but rather just "display" them to assist the user. Never save a value
that can be derived from a value (EmpID) whenever necessary.
The Name field ControlSource...
= cboYourEmpIDCombo.Coumn(1)
The Store field...
= cboYourEmpIDCombo.Coumn(2)

(columns in a combo are numbered left to right, 0, 1, , 2, etc..)
 
A

Al Camp

The RowSource is the query behind the combo... the ControlSource is the field that the
combo is "bound" to in the table behind your Form. (sounds like that would be EmplID)
That saves the ID selected to EmplID, but also provides the values for the Name and
Store "calculated" unbound fields.
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

TimM said:
Ok so my row source on the Emplid field is
SELECT Callers.Emplid, Callers.Name, Callers.Store FROM Callers;

What would I set the ControlSource to
= cboSELECT Callers.Emplid, Callers.Name, Callers.Store FROM Callers;.Coumn(1)
or what.

Also is this going to save it in the Call Log table. or will it only be
viewable one kinda thing.
 

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