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!

Link Fields from 2 tables ina form

Status
Not open for further replies.

Cpreston

MIS
Mar 4, 2015
972
GB
Hi

Is it possible to link 2 fields in a form from 2 different tables, so it then shows information from both tables.

I have a customer table and a salesrep table. I want to show the salesrep name on the form.

I have linked the tables using the salesrepid.

I have tried to add the name field from the salesrep table (=[dbo_SalesRep]![Name]) to the form with the customer information but all I get is #Name?

I know I can do this in a query but wondered if it was possible to do it just adding the field in rather than have querys.

Any ideas please.

Thanks
 
Using a query would be the simpler, cleaner, and normal way to do it. Not sure why you would want a work around. But you could use a calculated control and a dlookup with a where clause or a subform that holds the salesrep info and link it by salesrep id. What you propose makes no sense.
(=[dbo_SalesRep]![Name])
Even if you could do this, which you cannot, how would it know which salesrep name to show.
 
Yes your right, no idea why I though it this way, I will use query's.

Thanks
 
I expect the easiest, most common solution is to use a combo box bound to the SalesRepID with a Row Source like:

SQL:
SELECT SalesRepID, [Name] FROM tblSalesReps ORDER BY [Name];

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top