Oops, that doesn't let one override if it's supposed to be a different year. Try this instead:
Private Sub ctrandate_Chk(ChkStrg As String, retval As Integer)
If Year(CDate(Format$(ChkStrg, "00-00-0000"))) <> Year(Now) Then
Beep
Call MessBox("Re-check the year.", 257, "Different Year")
If MessResponse() = IDCANCEL Then Call ApplSetfocus("ctrandate")
End If
End Sub
------------------------------
Jonathan Van Houtte
Architect
XLstatements, LLC
Clifton Park NY
------------------------------
Original Message:
Sent: Nov 05, 2020 01:25 PM
From: Jonathan Van Houtte
Subject: Customization to restrict transaction date in Journal Transaction Screen
You could do something like this:
Private Sub ctrandate_Chk(ChkStrg As String, retval As Integer)
If Year(CDate(Format$(ChkStrg, "00-00-0000"))) <> Year(Now) Then
Beep
Call MessBox("Re-check the year.", MB_OK, "Different Year")
Call ApplSetfocus("ctrandate")
End If
End Sub
------------------------------
Jonathan Van Houtte
Architect
XLstatements, LLC
Clifton Park NY
------------------------------