Access doesn't support sql select but I also didn't run across an example where switch was used for anything other then setting string values.
Can I do this:
select
order.[amount], order.[date],
switch (order.[co type]=1, tblcustomers.[co name] as company name,
tblcustomers.[co email] as company email,
order.[co type]=2, tblsuppliers.[co name] as company name,
tblsuppliers.[co email] as company email
from
order, tblcustomers, tblsuppliers
where
order.do = true
Otherwise I ran across this link to do sql selects in Access VBA, I'm not knowledgeable enough to determine whether that code will work out for me or just store string values or not be able to check for more then just 1 group of values.
Can I do this:
select
order.[amount], order.[date],
switch (order.[co type]=1, tblcustomers.[co name] as company name,
tblcustomers.[co email] as company email,
order.[co type]=2, tblsuppliers.[co name] as company name,
tblsuppliers.[co email] as company email
from
order, tblcustomers, tblsuppliers
where
order.do = true
Otherwise I ran across this link to do sql selects in Access VBA, I'm not knowledgeable enough to determine whether that code will work out for me or just store string values or not be able to check for more then just 1 group of values.