L
lad5ko via AccessMonster.com
Hallo everyone,
In my database I have a Data/Time field wich I validate by Global modul –
that works fine. After validation user have to determine if he will
save/unsave changes (through dirty property of event BeforeUpdate of Form).
My code :
Private Sub Form_BeforeUpdate(Cancel As Integer)
Call Check_Date ' This works fine
If Dirty Then
If MsgBox("You want save changes?", _
vbYesNo + vbDefaultButton2 + 32, "DB2") = vbNo Then
Cancel = True
Me.Undo
End If
End If
End Sub
1. problem
After validation, when Date is incorrect is opened msgBox with „Date muss be
before June 30. 2006“ and after pressing „OK“ is immediately opened msgBox
with "You want save changes?". This question is a nonsense becouse he have
first correct „Date“ and after that – if is Date correct, by leaving the
record have to be opened question "You want save changes?".
2. problem
If user input correct Date msg "You want save changes?" appears but it is
impossible save the record.
I cann not make validation on field level of table or field level of form
because user can change validation rule in table or jump across the field in
form. It muss be done through event BeforeUpdate of Form (if it is possible).
Is there any way to do this? Thanks.
lad5ko
In my database I have a Data/Time field wich I validate by Global modul –
that works fine. After validation user have to determine if he will
save/unsave changes (through dirty property of event BeforeUpdate of Form).
My code :
Private Sub Form_BeforeUpdate(Cancel As Integer)
Call Check_Date ' This works fine
If Dirty Then
If MsgBox("You want save changes?", _
vbYesNo + vbDefaultButton2 + 32, "DB2") = vbNo Then
Cancel = True
Me.Undo
End If
End If
End Sub
1. problem
After validation, when Date is incorrect is opened msgBox with „Date muss be
before June 30. 2006“ and after pressing „OK“ is immediately opened msgBox
with "You want save changes?". This question is a nonsense becouse he have
first correct „Date“ and after that – if is Date correct, by leaving the
record have to be opened question "You want save changes?".
2. problem
If user input correct Date msg "You want save changes?" appears but it is
impossible save the record.
I cann not make validation on field level of table or field level of form
because user can change validation rule in table or jump across the field in
form. It muss be done through event BeforeUpdate of Form (if it is possible).
Is there any way to do this? Thanks.
lad5ko