D
DJN
Guest
I have been asked to modify a DB created by someone who has now left the company. Our financial year goes from 1st September to the 31st August At the end of the year the data is archived and analysed. On the input form there is a control (Flag) that holds the year, 2005. The form is based on a query that updates a master table. After archiving and at the beginning of a new year a small piece of code in the On Open event is triggered.
If IsNull(Me.Flag) And Now() > 31 / 8 / 5 Then
Me.Flag.DefaultValue = "2005"
End If
This puts the 'year' on the control Flag and is there each time the form is opened. Now for the problem. Looking at the code, it seems to me that it shouldn't work if there is anything in the control Flag? But it does. In addition, it would seem that this does not cater for a change in year and that the default value is changed manually!! I would like to change it so that the user enters the new year and subsequently the year be already in the control each time the form is opened.
Any help appreciated.
David
If IsNull(Me.Flag) And Now() > 31 / 8 / 5 Then
Me.Flag.DefaultValue = "2005"
End If
This puts the 'year' on the control Flag and is there each time the form is opened. Now for the problem. Looking at the code, it seems to me that it shouldn't work if there is anything in the control Flag? But it does. In addition, it would seem that this does not cater for a change in year and that the default value is changed manually!! I would like to change it so that the user enters the new year and subsequently the year be already in the control each time the form is opened.
Any help appreciated.
David