Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to find value selected from combo box

Status
Not open for further replies.

JosephRoy

Programmer
Mar 4, 2004
8
0
0
US
I have a form on which I have a combo box that is used to select an employee's name. I then want to see if this employee already has a record in a referral table. Here are my table layouts:

Employees
EmployeeID
Name

Referrals
Date
ReferralType
RefEmployeeID
.
.
.

The combo box is based on the Employees table and displays only the employee Name. After an employee is selected, I want to check the Referral table to see if there is already a record that has the same RefEmployeeID. If a referral record is found, I want to make another field on the form visible.

Any help would be appreciated.

Thanks,
Joe
 
Hello Joe,

Assuming that ReEmployeeID is the Foreign Key that links Referrals to Employees, then you can either use DLookUp or a SQL statement on the combo box's AfterUpDate event to search for any matching records in Referrals.

I think you will also want to include EmployeeID in one of the combobox's columns to provide the search parameter.

Cheers,
Bill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top