P
Pam
I have a main form "fGeneralInfo" with subform "fWorkLog" and subform
"fWorkLogComments". When user enters comments to subform fWorkLogComments
and they don't enter their name and date in fWorkLog.CboTech and
fWorkLog.StartTime, I want a msg to pop up telling them to do so and to set
the focus to CboTech and then StartTime if both are not filled in. I have
the following code on BeforeUpdate of the subform "fWorkLogComments". I
have entered may combinations of SetFocus and can get nothing to work. The
message will pop up, but if user clicks ok at each one, they will eventually
leave the form. I really need to have Tech and StartTimes required for
these entries.
I would very much appreciate any help with this.
Pam
Private Sub Form_BeforeUpdate(Cancel As Integer)
If IsNull(Me.Parent.fWorkLog!Tech) Then
Cancel = True
MsgBox "Please enter your name."
End If
If IsNull(Me.Parent.fWorkLog!StartTime) Then
Cancel = True
MsgBox "Please enter date for this comment in Start Time."
End If
End Sub
"fWorkLogComments". When user enters comments to subform fWorkLogComments
and they don't enter their name and date in fWorkLog.CboTech and
fWorkLog.StartTime, I want a msg to pop up telling them to do so and to set
the focus to CboTech and then StartTime if both are not filled in. I have
the following code on BeforeUpdate of the subform "fWorkLogComments". I
have entered may combinations of SetFocus and can get nothing to work. The
message will pop up, but if user clicks ok at each one, they will eventually
leave the form. I really need to have Tech and StartTimes required for
these entries.
I would very much appreciate any help with this.
Pam
Private Sub Form_BeforeUpdate(Cancel As Integer)
If IsNull(Me.Parent.fWorkLog!Tech) Then
Cancel = True
MsgBox "Please enter your name."
End If
If IsNull(Me.Parent.fWorkLog!StartTime) Then
Cancel = True
MsgBox "Please enter date for this comment in Start Time."
End If
End Sub