I have a text box which is supposed to take on date values. I would like to be able to check that an appropriate date value has been input in the text box, before the data is commited to the database. Thus, I tried using the beforeupdate() function of the text box, as shown below :
Private Sub Hmeromhnia_BeforeUpdate(Cancel As Integer)
If Not IsDate(Me.Hmeromhnia) Then
MsgBox "Μη αποδεκτή ημερομηνία", vbCritical
Cancel = True
I thought that would solve the problem. Yet, when I enter something other than a date, I get another Access internal error message instead of the one in my code. In fact, I think that the subroutine is not called at all. In case a correct date value in input then the subroutine is called correctly and exits gracefully!
Note, that the text box is part of a form and i`m using the beforeupdate() event of the form as well!