O
OD
Hi
Is there a functional limit to the size of a string that can be passed as a
recordsource to a report? I'm calling this code
strSQLResults = BuildProdsByVendors(intVendorID)
DoCmd.Echo False
DoCmd.OpenReport "rptPurchByPublisherByDate", acViewDesign
Reports("rptPurchByPublisherByDate").RecordSource = strSQLResults
DoCmd.Close , , acSaveYes
DoCmd.Echo True
DoCmd.OpenReport "rptPurchByPublisherByDate", acViewPreview
and passing this string as strSQLResults
SELECT tblVendors.VendID, tblVendors.Manufacturer, TransDetail.PurchDate,
Product.m_Number, Product.Product, TransDetail.UnitCost,
TransDetail.RequestedBy, TransDetail.RCNum, tblRCNumbers.Department FROM
Product INNER JOIN ((tblVendors INNER JOIN TransDetail ON tblVendors.VendID =
TransDetail.Publisher) INNER JOIN tblRCNumbers ON TransDetail.RCNum =
tblRCNumbers.RC) ON (tblVendors.VendID = Product.VendID) AND
(Product.m_Number = TransDetail.m_Number) WHERE (((tblVendors.VendID) = 5))
ORDER BY TransDetail.PurchDate;
The reason I'm asking is the query runs fine except that the report is not
in PurchDate order. I've tried setting the order to purchdate but it doesn't
recognize the variable and I've tried hard coding it in the report but it
gets overwritten each time I run the query.
Any help is greatly appreciated
Thank you
Is there a functional limit to the size of a string that can be passed as a
recordsource to a report? I'm calling this code
strSQLResults = BuildProdsByVendors(intVendorID)
DoCmd.Echo False
DoCmd.OpenReport "rptPurchByPublisherByDate", acViewDesign
Reports("rptPurchByPublisherByDate").RecordSource = strSQLResults
DoCmd.Close , , acSaveYes
DoCmd.Echo True
DoCmd.OpenReport "rptPurchByPublisherByDate", acViewPreview
and passing this string as strSQLResults
SELECT tblVendors.VendID, tblVendors.Manufacturer, TransDetail.PurchDate,
Product.m_Number, Product.Product, TransDetail.UnitCost,
TransDetail.RequestedBy, TransDetail.RCNum, tblRCNumbers.Department FROM
Product INNER JOIN ((tblVendors INNER JOIN TransDetail ON tblVendors.VendID =
TransDetail.Publisher) INNER JOIN tblRCNumbers ON TransDetail.RCNum =
tblRCNumbers.RC) ON (tblVendors.VendID = Product.VendID) AND
(Product.m_Number = TransDetail.m_Number) WHERE (((tblVendors.VendID) = 5))
ORDER BY TransDetail.PurchDate;
The reason I'm asking is the query runs fine except that the report is not
in PurchDate order. I've tried setting the order to purchdate but it doesn't
recognize the variable and I've tried hard coding it in the report but it
gets overwritten each time I run the query.
Any help is greatly appreciated
Thank you