Retrieving a Value (1 Viewer)

sajarac

Registered User.
Local time
Today, 10:28
Joined
Aug 18, 2015
Messages
126
Hi there, silly question here:

I would like to retrieve a values from another table and here is my situation:

I have a subform with a combo box, that combo box is a list of the sales rep and also I have a textbox and it htat box I have: =[Sales Rep].[Colum][2] by doing this I can retrieve the region of each sales rep.

Now I have another table "Sales Rep Manager" in that table I have:
ManagerID
Region
Code

What I am trying to do is in the subform when I select a sales rep a field check what ids the region and brings the code that match that region.

Sorry, but I cannot figure this.

Any help will be very appreciated.

Regards,
 

jdraw

Super Moderator
Staff member
Local time
Today, 10:28
Joined
Jan 23, 2006
Messages
15,362
I suggest you post a copy of your database (zip format).
 

CJ_London

Super Moderator
Staff member
Local time
Today, 14:28
Joined
Feb 19, 2013
Messages
16,553
easiest way is to include your manager table in the rowsource to your combo and bring through the code as an additional column
 

sajarac

Registered User.
Local time
Today, 10:28
Joined
Aug 18, 2015
Messages
126
Hi, I can do the first part, but I don't know about this: "bring through the code as an additional column"
 

CJ_London

Super Moderator
Staff member
Local time
Today, 14:28
Joined
Feb 19, 2013
Messages
16,553
rowsource for your combo is presumably something like this

Code:
SELECT tblSalesPeople.ID, tblSalesPeople.SalesName, tblSalesPeople.Region
FROM tblSalesPeople
Modify to something like

Code:
SELECT tblSalesPeople.ID, tblSalesPeople.SalesName, tblSalesPeople.Region, tblManagers.Code
FROM tblSalesPeople INNER JOIN tblManagers ON tblSalesPeople.Region=tblManagers.Region
and increase column count from 3 to 4.

Then in another control to display the code you would have

=myCombo.Column(3)
 

Users who are viewing this thread

Top Bottom