UFOGoldorak Posted November 29, 2007 Posted November 29, 2007 I've got a contacts table and a viewer table. How can I display 2 different records from the contacts table onto the viewer. ie one address for billing and another address for shipping? I've searched and apparently nesting portals won't work. Aside from having exact duplicate contacts tables or copying the field info back and forth what are my options? Thanks.
bcooney Posted November 29, 2007 Posted November 29, 2007 What's a viewer table? What is its purpose?
UFOGoldorak Posted November 30, 2007 Author Posted November 30, 2007 The viewer table and layout just combine all my info from other tables be it portals or calculations into a front end to my database. It for example has a job number field that relates to an items portal from another table that lists everything that need to be done with that job. I would like to add a "ship to address" and a "bill to addres" sections to that layout. It's no problem if I only needed one or the other then I could just add a portal. Now since the bill to address and ship to address don't always match, how can I make it where it accesses two different records from the "Contacts" table? Hope that makes sense. Thanks.
bcooney Posted November 30, 2007 Posted November 30, 2007 Why would the two addresses be two different records in the Contacts table? Why aren't they fields in the contacts table? So, on your viewer layout, when you sent the ContactID global, you'd see that contact's addresses thru a relationship back to Contacts. I see that you rate yourself a novice, so I feel that I should advise you that trying to have your entire database operate from one "viewer" layout is going to complicate your development tremendously. Why not just have a job layout?
UFOGoldorak Posted November 30, 2007 Author Posted November 30, 2007 1 record per address on the contacts table. The 2 addresses don't always match to be on the same record. Sometimes they will be the same, other times the addresses will be different. In other words some times i will ship and bill "John" and other times I will ship to "John" and bill to "joe". Here's a couple of screen shots..
bcooney Posted December 1, 2007 Posted December 1, 2007 You need to store a foreign key (of the respective contact) for the Bill To and the Ship TO in the Job Table.
UFOGoldorak Posted December 2, 2007 Author Posted December 2, 2007 Would it be too much for me to ask what a foreign key is? Or would you mind pointing me in the right direction with a link to read? Thank you for your time.
bcooney Posted December 2, 2007 Posted December 2, 2007 How about reading the White Paper for Novices? Link
UFOGoldorak Posted December 3, 2007 Author Posted December 3, 2007 Thank you, that was good reading material but I am still not sure how to accomplish what I need done. Here is a simple test file of what I am trying to do. Everything I have tried either gets me the same "Name" for both shipping and billing or nothing at all. I just can't figure out how to make it display 2 different records or 2 same records from the contacts table at the same time in 2 different places on one main layout. Thanks.
bcooney Posted December 3, 2007 Posted December 3, 2007 (edited) Let's go back to the Viewer table. I believe you'd find it much easier to just have this layout based on a Job Table Occurrence. Then, have the _kF_BillTO_ID and _kF_ShipTo_ID (foreign contact id keys) on this layout. They can be popup menus that use a value list. The value list can be called Contacts, and it would contain the ContactID and the Contact Name & Address (this second field is a calculation field that concatenates Name & Address). Once you have the _kF_BillTO_ID stored in Jobs, then you can lookup the bill to address info in Contacts using relationship from Jobs to Contacts where _kF_BillTo_ID = __kP_ContactID. Similarly for ShipTo. Edited December 3, 2007 by Guest
Recommended Posts
This topic is 6200 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now