I have a form that is displayed for the user to enter a date.
I wrote a query that I want to use this date(parameter) to calculate the number of days from that date.
For example: Now()-Max(Date of Distribution,DateAttended) <=180
This would take todays date and subtract the largest DateAttended date in table Distribution.
This query works fine.
When I try to substitute the function Now() with the control DateofBook that is on the form that the user entered I get this error. Expression is too complex etc.
Field line expr1: [Forms]![HomePage]![NavegationSubform].[Form]![DateofBook]-Max([Dates of Distribution]![DateAttended])
Criteria line in query <=180
I know that the path for DateofBook is correct because it prints out nicely on the report.
In the report the data source is this query that I wrote.
I tried many different ways to solve this issue. I used parenthesis around enclosing each of the fields to be subtracted for simplicity with no luck.
Any help will be greatly appreciated.
I have been struggling with this for 5 days. I don't want to put a prompt in the query for the field DateBook field, because then the user will be required to enter the same date twice. Once for the query and once on the report form.
Many thanks for your help.
Jim (new user to access2010)
I wrote a query that I want to use this date(parameter) to calculate the number of days from that date.
For example: Now()-Max(Date of Distribution,DateAttended) <=180
This would take todays date and subtract the largest DateAttended date in table Distribution.
This query works fine.
When I try to substitute the function Now() with the control DateofBook that is on the form that the user entered I get this error. Expression is too complex etc.
Field line expr1: [Forms]![HomePage]![NavegationSubform].[Form]![DateofBook]-Max([Dates of Distribution]![DateAttended])
Criteria line in query <=180
I know that the path for DateofBook is correct because it prints out nicely on the report.
In the report the data source is this query that I wrote.
I tried many different ways to solve this issue. I used parenthesis around enclosing each of the fields to be subtracted for simplicity with no luck.
Any help will be greatly appreciated.
I have been struggling with this for 5 days. I don't want to put a prompt in the query for the field DateBook field, because then the user will be required to enter the same date twice. Once for the query and once on the report form.
Many thanks for your help.
Jim (new user to access2010)