I have a query which takes a few fields and sorts them. The intention is that the user inputs how far back it would like the database to display results from, and then that value is used. For example, the user inputs '4', and the database displays the results from the last 4 months, but not before then.
I have it set up so it works with a number inputted into the code, such as 3 months or 4 months, but I can't get it to work with a user-inputted number.
The current idea was to use a OnOpen event on the report, setting a variable called NoOfMonths with the inputted value. However, it doesn't seem that this value can then be used in the code, because it doesn't recognise it when I try to use it in the query...
How would I get around this?