Can't reference two controls with the same source

T

T. Utley

I'm creating rptServiceOrder from qryServiceOrder. The query runs fine
producing the correct data in the correct order, so I'm perplexed over why I
can't reproduce the same results on my form. I do want to have two report
controls that are ultimately bound to tblCustomers (one directly from
tblCustomers.CustomerName, and one from a select
query--qryCemeteries.CustomerName). My problem: I can successfully add the
control qryCustomers.CustomerName, but when I attempt to add
tblCustomers.CustomerName in form design view, I get the following error
message when Previewing the report:

"The specified field 'tbleCustomers.CustomerName' could refer to more than
one table listed i the FROM clause of your SQL statement."

Here's the SQL statement on which frmServiceOrder is based:

SELECT qrySales.ProductSaleID, qrySales.SaleDate, tblCustomers.CustomerName,
tblProducts.ProductType, qryCemeteries.CustomerName, tblCities.CityName,
tblCounties.CountyName, tblBillingPeriod.BillingPeriod, qrySales.Discount,
qrySales.[Billing Method], qrySales.SaleExpires, qrySales.SaleAmount
FROM tblCustomerCategories INNER JOIN (qryCemeteries RIGHT JOIN
(((((qrySales INNER JOIN tblProducts ON qrySales.ProductTypeID =
tblProducts.ProductTypeID) INNER JOIN tblCustomers ON qrySales.CustomerID =
tblCustomers.CustomerID) INNER JOIN tblBillingPeriod ON qrySales.BillingID =
tblBillingPeriod.BillingID) LEFT JOIN tblCities ON qrySales.CityID =
tblCities.CityID) LEFT JOIN tblCounties ON qrySales.CountyID =
tblCounties.CountyID) ON qryCemeteries.CustomerID = qrySales.CemeteryID) ON
tblCustomerCategories.CategoryID = tblCustomers.CategoryID;

I'm guessing the fix is minor, but I sure can't figure it out. Can someone
help? Thanks so much.
 
Top