G
Guest
I used the example in the following website to tell the user that they can't
save information without entering information first.
http://www.databasedev.co.uk/required_data.html
The thing is that I have several checkboxes and a few text boxes that depend
on others. on my form and they are not all required. so i have that
function on my form but to implement it is how I don't know.
This is what I have on my before update of the form
Private Sub Form_BeforeUpdate(Cancel As Integer)
if (Me.Noreasons = 0 Or IsNull(Me.NoReasons)) And _
(Me.EmplAccess = 0 Or IsNull(Me.EmplAccess)) And _
(Me.EmplLeave = 0 Or IsNull(Me.EmplLeave)) And _
(Me.EmplLength = 0 Or IsNull(Me.EmplLength)) then _
If RequiredData(Me) Then Cancel = -1
End If
if isnull(me.bDay) then
If RequiredData(Me) Then Cancel = -1
me.bday.setfocus
end if
****************************************
For example if I don't put anything in BDay textbox I am getting a
messagebox saying data is required in text0, please ensure that this is
entered.
How do I add text to my before update to say instead of text0 to say
"Missing Birthday date" or if i did not select the checkboxes say "missing
Employee reasons"
save information without entering information first.
http://www.databasedev.co.uk/required_data.html
The thing is that I have several checkboxes and a few text boxes that depend
on others. on my form and they are not all required. so i have that
function on my form but to implement it is how I don't know.
This is what I have on my before update of the form
Private Sub Form_BeforeUpdate(Cancel As Integer)
if (Me.Noreasons = 0 Or IsNull(Me.NoReasons)) And _
(Me.EmplAccess = 0 Or IsNull(Me.EmplAccess)) And _
(Me.EmplLeave = 0 Or IsNull(Me.EmplLeave)) And _
(Me.EmplLength = 0 Or IsNull(Me.EmplLength)) then _
If RequiredData(Me) Then Cancel = -1
End If
if isnull(me.bDay) then
If RequiredData(Me) Then Cancel = -1
me.bday.setfocus
end if
****************************************
For example if I don't put anything in BDay textbox I am getting a
messagebox saying data is required in text0, please ensure that this is
entered.
How do I add text to my before update to say instead of text0 to say
"Missing Birthday date" or if i did not select the checkboxes say "missing
Employee reasons"