I have a form with a textbox that is being used as a criteria for a query
When I run the query I get 'this expresion is typed incorrectly, or it is too complex to be evaluated. For example, a numeric expression may contain too many complicated elemnts. Try simplifying the expression by assigning parts of the expression to variables.'
The text Box passes a DateAdd function of the form >=DateAdd("m",-3,Date())
If I enter this value directly the query works, if it is entered as [Forms]![ReportSection].[DateQuery] it throws up this error.
I can't think of any way to simplify this expression to give me what I need.
Please someone help!
Here is my query
SELECT Invoice.DateSent, DealerDistributor.DealerDistName, Invoice.InvoiceNumber, NewUnit.UnitType, NewUnit.Zones, NewUnit.Upgrade, NewUnit.TeamviewerCode
FROM (DealerDistributor INNER JOIN Invoice ON DealerDistributor.DealerDistName = Invoice.DealerDistName) INNER JOIN NewUnit ON Invoice.InvoiceNumber = NewUnit.InvoiceNumber
WHERE (((Invoice.DateSent)=[Forms]![ReportSection].[DateQuery]) AND ((NewUnit.Status)="Sent"));
When I run the query I get 'this expresion is typed incorrectly, or it is too complex to be evaluated. For example, a numeric expression may contain too many complicated elemnts. Try simplifying the expression by assigning parts of the expression to variables.'
The text Box passes a DateAdd function of the form >=DateAdd("m",-3,Date())
If I enter this value directly the query works, if it is entered as [Forms]![ReportSection].[DateQuery] it throws up this error.
I can't think of any way to simplify this expression to give me what I need.
Please someone help!
Here is my query
SELECT Invoice.DateSent, DealerDistributor.DealerDistName, Invoice.InvoiceNumber, NewUnit.UnitType, NewUnit.Zones, NewUnit.Upgrade, NewUnit.TeamviewerCode
FROM (DealerDistributor INNER JOIN Invoice ON DealerDistributor.DealerDistName = Invoice.DealerDistName) INNER JOIN NewUnit ON Invoice.InvoiceNumber = NewUnit.InvoiceNumber
WHERE (((Invoice.DateSent)=[Forms]![ReportSection].[DateQuery]) AND ((NewUnit.Status)="Sent"));