In other words, when a quarter ends, the Administrator must file a quarterly report, once this report id filed, he MUST complete the process by updating tblFilingDates with the date the report was filed.
Everything seems to work in year 2006 until we entered into the year 2007. Suddenly the db locked out....and the only way to unlock the form and keep it open is only when there is a date entry in tblFilingDates.DateFiled.
My On Load Event code is bypassing the date entry field or not reading it at all.
The same code is also duplicated at the AfterUpdate Event of txtPermitNo whic is also malfunctioning as dexcribed above..
Below is the On Load Event code of frmSewer.
Expand|Select|Wrap|Line Numbers
- Private Sub Form_Load()
- Dim iQQ As Integer
- Dim iYY As Integer
- 'Get current quarter/year based on system date
- iQQ = DatePart("q", Date)
- iYY = DatePart("yyyy", Now())
- 'If current date is not last of last quarter
- If DateIsLastQuarterDate(Now()) = False Then
- 'If quarter 1 then for previous quarter, we need to subtract the year also
- If iQQ = 1 Then
- iQQ = 4
- iYY = iYY - 1
- Else
- iQQ = iQQ - 1
- End If
- End If
- 'Call the function GracePeriodValidation to see if we are in within the grace period
- 'If not then throw an error
- If GracePeriodValidation(Now(), iQQ, iYY) = False Then
- MsgBox "You cannot proceed as no filing date has been entered" & vbCrLf & _
- "for quarter " & iQQ & " " & iYY & "." & vbCrLf & _
- "Please contact your administrator.", vbOKOnly + vbExclamation, FRM_TITLE
- DoCmd.Close
- End If
- End Sub