R
Radhika
The form I am working with has two fields that come from the same table:
1. Out of institution and off floor (drop down)
2. # Hours Worked (Text Field)
I am trying to create a code so that if 'PTO-half day' is selected in the
'Out of institution and off floor' field, a message comes up saying '# Hours
Worked' must be entered.
OR If 'PTO-half day' is selected in 'Out of institution and off floor' field
and '# Hours Worked' is left blank, a message comes up saying '# Hours
Worked' must be entered.
Here is what I tried:
In the Before Update event for 'Out of institution and off floor field', I
put in the following code:
Const ConMESSAGE = _
"Must enter # hrs worked."
If [Out of the institution and off the floor] = "PTO-half day" Then
MsgBox ConMESSAGE, vbExclamation, "Invalid Operation"
Cancel = True
End If
However, this always gives me an error msg when 'PTO-half day' is selected
and does not let me enter anything in '# Hours Worked.
How can I fix this?
Thank you
Radhika
1. Out of institution and off floor (drop down)
2. # Hours Worked (Text Field)
I am trying to create a code so that if 'PTO-half day' is selected in the
'Out of institution and off floor' field, a message comes up saying '# Hours
Worked' must be entered.
OR If 'PTO-half day' is selected in 'Out of institution and off floor' field
and '# Hours Worked' is left blank, a message comes up saying '# Hours
Worked' must be entered.
Here is what I tried:
In the Before Update event for 'Out of institution and off floor field', I
put in the following code:
Const ConMESSAGE = _
"Must enter # hrs worked."
If [Out of the institution and off the floor] = "PTO-half day" Then
MsgBox ConMESSAGE, vbExclamation, "Invalid Operation"
Cancel = True
End If
However, this always gives me an error msg when 'PTO-half day' is selected
and does not let me enter anything in '# Hours Worked.
How can I fix this?
Thank you
Radhika