Oops, wrote this last night and apparently forgot post it.
simplified:
Code:
If GetFiscalYear(EntryDate) <> GetFiscalYear(Date) Then
Cancel = True
MsgBox "The prior fiscal year is locked. You cannot make changes to records from that period.", vbExclamation, "Update Error"
Else
MsgBox "The fiscal year is: " & GetFiscalYear(EntryDate)
End If
Hard to tell where your error is. you don't show enough code or error.
Not sure what this is but I dont see a variable RideDate dimensioned anywhere. That would error.
Code:
' Assuming you have a control named "RideDate" on the form
RideDATE = Me!RideDATE
Where's EntryDate coming from?
Code:
FiscalYear = GetFiscalYear(EntryDate)
Even if I change the name, it still gives me the same thing. The field date is obviously not the reason.
Using reserved words can cause random, sporadic errors so don't dismiss them.
http://allenbrowne.com/AppIssueBadWord.html
Also note that testing for FY being < than current FY wont prevent entry of a date > than the current FY. Your test should be <> current FY.