OK, I thought that I understood table relationships, but I'm still trying to wrap my head around it, and I'm feeling dumber with each failed attempt.
I've uploaded a copy of my file, which should help illustrate my problem.
I have 3 tables - Customers, Stores, and Work Orders.
Each table has a self-joined instance. The ViewCustomers object for viewing a list of customers thru a Portal. The ViewStores object links to a global variable "gCustomerID" in the Customers table so a 2nd portal can show only the stores that belong to a specific customer.
That part is working fine, however...
I really make a mess of things when I try to link Work Orders to a Store by a "StoreID" field. Like I said, I'm still trying to wrap my head around not only the table relationships, but also the layout design, where the layout table is defined compared to which table the Portal is using along with the individual Portal fields.
This is how I want it to work: The user starts at the "Home" layout, selects a customer, then a store. The "Store Details" page opens up, and from there you can see Open Work Orders, and create a New Work Order. The problem is that I'm trying to set up a self-join to the Work Orders table using a global variable "gComplete" so in one tab I can show only Work Orders that are Open, and in the other tab I can show only Work Orders that are Complete.
I also don't understand how I can get the Customer Name to show on my "Store Details" layout. I want to somehow pull it from the Customers table without creating a redundant field in the Stores table. In SQL, I would have said something like SELECT Name FROM Customers WHERE CustomerID = variable
Can someone tell me how many things I'm doing wrong? I am welcome to any and all criticism, anything that will help me understand what I should be doing.
Thanks!
Stores.zip