combo box to update record via form

T

tecas

I have a combo box that displays the EmployeeID, FirstName, and
LastName from the Employee Table. The user is to pick the employee and
I want the ID stored in the DataEntry table. The combo box pulls all
of the employees from their table via the following query associated
with the combo box

SELECT tblEmployeeInformation.[Last Name], tblEmployeeInformation.
[First Name], tblEmployeeInformation.[Employee ID]
FROM tblEmployeeInformation
ORDER BY tblEmployeeInformation.[Last Name];

I have the bound column for that combo box set to 3 yet the table
always updates with the employees last name. How to i set this up so
that the table updates with the employee's id number?
 
J

John W. Vinson

I have a combo box that displays the EmployeeID, FirstName, and
LastName from the Employee Table. The user is to pick the employee and
I want the ID stored in the DataEntry table. The combo box pulls all
of the employees from their table via the following query associated
with the combo box

SELECT tblEmployeeInformation.[Last Name], tblEmployeeInformation.
[First Name], tblEmployeeInformation.[Employee ID]
FROM tblEmployeeInformation
ORDER BY tblEmployeeInformation.[Last Name];

I have the bound column for that combo box set to 3 yet the table
always updates with the employees last name. How to i set this up so
that the table updates with the employee's id number?

What's the Control Source of the combo box? Do you perhaps have this table
defined as a <yuck!> Lookup Field? Perhaps it's *storing* the ID but the
Lookup is *displaying* the name.

John W. Vinson [MVP]
 
T

tecas

I have a combo box that displays the EmployeeID, FirstName, and
LastName from the Employee Table. The user is to pick the employee and
I want the ID stored in the DataEntry table. The combo box pulls all
of the employees from their table via the following query associated
with the combo box
SELECT tblEmployeeInformation.[Last Name], tblEmployeeInformation.
[First Name], tblEmployeeInformation.[Employee ID]
FROM tblEmployeeInformation
ORDER BY tblEmployeeInformation.[Last Name];
I have the bound column for that combo box set to 3 yet the table
always updates with the employees last name. How to i set this up so
that the table updates with the employee's id number?

What's the Control Source of the combo box? Do you perhaps have this table
defined as a <yuck!> Lookup Field? Perhaps it's *storing* the ID but the
Lookup is *displaying* the name.

John W. Vinson [MVP]

I just finished checking my table prior to reading your post and the
previous developer had the field in the table defined as a <yuck!>
combo box. I changed all of the afftected fields (yes, there was more
than one defined that way in the table) and my data magically
appeared.

Thanks for the response.
 
T

Tom Wickerath

Hi Tecas,

As you have discovered, Lookups defined at the table (or query) level art
thy creation of thy evil one. See the 2nd Commandment, here:

The Ten Commandments of Access
http://www.mvps.org/access/tencommandments.htm

Access MVP Alumnus Jeff Conrad has a slick add-in tool available that you
can download and install. One of the features of this add-in includes the
ability to quickly locate all table lookups. You might want to give it a try:

CSD Tools Database Documentation
http://www.accessmvp.com/JConrad/accessjunkie/csdtools.html

*Note: This tool has not been updated for Access 2007


Tom Wickerath
Microsoft Access MVP
https://mvp.support.microsoft.com/profile/Tom
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________
 

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

Similar Threads


Top