I have four tables:
Contacts
Employees
Customers
Vendors
The Contacts table is the primary table; it contains 3 fields:
is_customer
is_vendor
is_employee
When I display my contacts table to add a new contact, when I check the box 'is_customer' I want it to show the customers tab. If I check the box 'is_vendor', I want it to show the vendors tab. If I check the box 'is_employee', I want it to show the employee tab. (and oh btw; I also want to - if I get this working - show a security tab too so that I might add the user to the security table - but I am not real concerned with that at the moment - and - to get a little more complicated - I only want to show the employee tab and security tab if the person logged in is an administrator)
I am using an SQL Select statement builder:
SELECT *
FROM (contacts contacts
INNER JOIN vendors vendors
ON contacts.contact_id = vendors.contact_id
INNER JOIN customers customers
ON contacts.contact_id = customers.customer_id
INNER JOIN employees employees
ON contacts.contact_id = employees.contact_id )
I don't see any data on the preview tab.
If I change the joins so that I am using one child table (any child table) I do see data on the preview tab.
The other problem is that I want to selectively show the child panes based on the values 'is_customer', "is_vendor' and 'is_employee'. It works for the first table but not the others.
I am thinking that I might need to write my own SQL statement (not real good at that) but on the other hand, I think this should work.
Maybe I need to go to bed. ;-)
Happy Veterans Day btw to everyone .. have to go march in a hour.
Contacts
Employees
Customers
Vendors
The Contacts table is the primary table; it contains 3 fields:
is_customer
is_vendor
is_employee
When I display my contacts table to add a new contact, when I check the box 'is_customer' I want it to show the customers tab. If I check the box 'is_vendor', I want it to show the vendors tab. If I check the box 'is_employee', I want it to show the employee tab. (and oh btw; I also want to - if I get this working - show a security tab too so that I might add the user to the security table - but I am not real concerned with that at the moment - and - to get a little more complicated - I only want to show the employee tab and security tab if the person logged in is an administrator)
I am using an SQL Select statement builder:
SELECT *
FROM (contacts contacts
INNER JOIN vendors vendors
ON contacts.contact_id = vendors.contact_id
INNER JOIN customers customers
ON contacts.contact_id = customers.customer_id
INNER JOIN employees employees
ON contacts.contact_id = employees.contact_id )
I don't see any data on the preview tab.
If I change the joins so that I am using one child table (any child table) I do see data on the preview tab.
The other problem is that I want to selectively show the child panes based on the values 'is_customer', "is_vendor' and 'is_employee'. It works for the first table but not the others.
I am thinking that I might need to write my own SQL statement (not real good at that) but on the other hand, I think this should work.
Maybe I need to go to bed. ;-)
Happy Veterans Day btw to everyone .. have to go march in a hour.