johnsqftwr
Registered User.
- Local time
- Today, 00:47
- Joined
- Jul 19, 2004
- Messages
- 29
Hi All,
I have a form with 2 Memo Fields. CallReasonComments and HowResolved.
TheCallReasonComments must always be completed and the HowResolved must be filled in if the Resolved Check Box is ticked.
I have searched the threads and the form before update event is as follows:
Private Sub Form_BeforeUpdate(Cancel As Integer)
If IsNull(Me.CallReasonComments) Then
MsgBox "The Reason Must Be Expanded In The Comments Field", _
vbCritical, _
"Canceling Update"
Me.CallReasonComments.SetFocus
Cancel = True
End If
If Me.Resolved = -1 And IsNull(Me.HowResolved) Then
MsgBox "How Resolved Must Be Completed", _
vbCritical, _
"Canceling Update"
Me.HowResolved.SetFocus
Cancel = True
End If
End Sub
The form also has 2 Buttons.
Save And Go to new record (Macro) AND Close
If the buttons are clicked the following happens
Save And Go To new Record:
Action Failed (Trying to run macro) followed by 'You can't go to the specified record'
Close: Simply closes the form without any warning that the record hasn't been saved.
I would like to stop these button working if the before update criteria has not been complied with.
Any help greatly appreciated.
Regards
I have a form with 2 Memo Fields. CallReasonComments and HowResolved.
TheCallReasonComments must always be completed and the HowResolved must be filled in if the Resolved Check Box is ticked.
I have searched the threads and the form before update event is as follows:
Private Sub Form_BeforeUpdate(Cancel As Integer)
If IsNull(Me.CallReasonComments) Then
MsgBox "The Reason Must Be Expanded In The Comments Field", _
vbCritical, _
"Canceling Update"
Me.CallReasonComments.SetFocus
Cancel = True
End If
If Me.Resolved = -1 And IsNull(Me.HowResolved) Then
MsgBox "How Resolved Must Be Completed", _
vbCritical, _
"Canceling Update"
Me.HowResolved.SetFocus
Cancel = True
End If
End Sub
The form also has 2 Buttons.
Save And Go to new record (Macro) AND Close
If the buttons are clicked the following happens
Save And Go To new Record:
Action Failed (Trying to run macro) followed by 'You can't go to the specified record'
Close: Simply closes the form without any warning that the record hasn't been saved.
I would like to stop these button working if the before update criteria has not been complied with.
Any help greatly appreciated.
Regards