I have a form with which I enter data. A sort order, start date and end date.
Once the data is entered, a report is generated. But I get and error.
Error: “The Microsoft Access database engine does not recognize ‘[Forms]![AuditPTETotals]![startDate]’ as a valid field name or expression.
This is my crosstab (AuditPTETotals_CrosstabDateRange) query which uses the data retrieved by another query (AuditPTETotalsDateRange)
TRANSFORM Sum(AuditPTETotalsDateRange.PTEtotal) AS SumOfPTEtotal
SELECT AuditPTETotalsDateRange.companyName, AuditPTETotalsDateRange.regNum, Sum(AuditPTETotalsDateRange.PTEtotal) AS [Total Of PTEtotal]
FROM AuditPTETotalsDateRange
GROUP BY AuditPTETotalsDateRange.companyName, AuditPTETotalsDateRange.regNum
PIVOT AuditPTETotalsDateRange.description;
And this is AuditPTETotalsDateRange
SELECT CUSTOMER.regNum, CUSTOMER.companyName, ScrapTireType.description, ScrapTireType.PTEamount, ScrapCollectionTireType.amount, ScrapCollection.PTEtotal, ScrapCollection.Date
FROM (ScrapCollection INNER JOIN CUSTOMER ON ScrapCollection.regNum = CUSTOMER.regNum) INNER JOIN (ScrapTireType INNER JOIN ScrapCollectionTireType ON (ScrapTireType.scrapTireTypeID = ScrapCollectionTireType.scrapTireTypeID) AND (ScrapTireType.scrapTireTypeID = ScrapCollectionTireType.scrapTireTypeID)) ON ScrapCollection.scrapCollectionID = ScrapCollectionTireType.scrapCollectionID
WHERE (((ScrapCollection.Date) Between [Forms]![AuditPTETotals]![startDate] And [Forms]![AuditPTETotals]![endDate]));
I have used this approach in a similar way to reference forms fields in a query but this time, I am not sure what I’m doing wrong. Please help.
Thank you
I found a solution! I was using a Date/Time format on my controls. I think it was messing up with the actual format of my parameters. Instead I used a regular text box and set an input mask to it. It worked.