Thanks for the reply. My issue is not setting the variables, that part is fine. Sorry if I was not clear.
My problem is applying the values of the variables to the date field when the document is opened.
For instance, I set the end date to the latest activity in the financial year (say 15/10/2010), and the start date is simply the beginning of that year (01/04/2010 for example). Now, when the document is opened, I would like the date field to be set to the range 01/04/2010 to 15/10/2009.
The field is used all over the application.
Is there a way to make an OnOpen trigger that will set the a DateField field to a range as opposed to an individual date. Essentially I require the equivalent of:
Settings > Document Properties > Triggers > OnOpen
Action: Select in Field
SerachString: =Between varStartDate AND varEndDate
So when the user opens the application the DateField will already be set to the year to date latest data.
Maybe I need a Macro for this and fire the Macro in the OnOpen trigger.