Full Version: Getting data from foreign keys to show
UtterAccess Discussion Forums > Microsoft® Access > Access Tables + Relationships
auction1
I have a database that I am creating that will be fed by an InfoPath form. I've attached a picture of the relationships that I have set up. I have two questions.

first, In using the PersonID as a foreign key, I want the tblRequests to display FieldOffice once for each entry and Each PersonName chosen for the field office. The PersonType is either Sales Coordinator or Sales Rep. How do I get PersonName and PersonType to display for each person selected for each request?

Second, Do I need to separate PersonType into two tables? One for Sales Coordinator and one for Sales Rep?

I want the InfoPath form to have a labeled box for each role and a place to enter the person's name for each role. I hope this makes sense.

Thanks in advance for your help.

Auction1
ScottGem
Since the FieldOffice name is not stored in same table as the person, I would use a DLookup. In the After Update event of the combo where the person is chosen, use code like:

Me.txtFieldOffice = Dlookup("[FieldOfficeName]',"tblFieldOffice", "[FieldOfficeID] = " & Me.cboPerson,Column(2))
auction1
Are you referring to the InfoPath form control or to the PersonType field in tblPersonType?

Also, any thoughts on question #2?

Thanks.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.