Hi
I wish to add a command button which on the click event does the following
1 Saves the current record
2 Prompts the user with the question " Do you which to print lab sheet for this batch"
3 If the user selects Ok then the report "Lab Sheet" runs, if they select cancel I wish to close the form.
I have got as far as detailed below but am struggling now
Private Sub Samplescompleteforbatch_Click()
Me.Dirty = False
RetValue = MsgBox("Print Lab Sheet for this Batch?", vbOKCancel)
If RetValue = vbOK Then
DoCmd.OpenReport [Lab_Sheet], acViewPreview
End If
End Sub
I wish to add a command button which on the click event does the following
1 Saves the current record
2 Prompts the user with the question " Do you which to print lab sheet for this batch"
3 If the user selects Ok then the report "Lab Sheet" runs, if they select cancel I wish to close the form.
I have got as far as detailed below but am struggling now
Private Sub Samplescompleteforbatch_Click()
Me.Dirty = False
RetValue = MsgBox("Print Lab Sheet for this Batch?", vbOKCancel)
If RetValue = vbOK Then
DoCmd.OpenReport [Lab_Sheet], acViewPreview
End If
End Sub