I have an Archive process that is started by a button on a form. However...I want a BIG warning when the button is depressed. The user must realize there are ramifications if they continue. The standard MsgBox is a little too tame for this situation. So, I built a WARNING form. At the bottom of the form is a toggle group. Yes continue archive = 1 and No =2
My code for the archive button...not on the warning form.
'DoCmd.OpenForm "frm_Archive_Warning", acNormal, "", "", acEdit, acNormal
'If [Forms]![frm_Archive_Warning]![Frame7] = 1 Then
I am not sure where to go from here. Will the code wait for the results of the Frame7. I do not have a default value for the frame so it all depends on which button is clicked. So, I don't want anything to happen until a button is clicked. If yes is clicked, I want to close the warning form and continue with the code below. If No is clicked I want to close the warning form and bypass the code below.
If Is_It_Archived = True Then
MsgBox "This record has already been archived"
Else
Dim Rev
Rev = Revision
'MsgBox Rev
DoCmd.SetWarnings WarningsOff
DoCmd.OpenQuery "qry_Archive_Main_Admin_To_ADB", acNormal, acEdit
DoCmd.OpenQuery "qry_Archive_Major", acNormal, acEdit
DoCmd.OpenQuery "qry_Archive_Minor", acNormal, acEdit
DoCmd.OpenQuery "qry_Archive_Media", acNormal, acEdit
DoCmd.SetWarnings WarningsOn
MsgBox "Revision " & Rev & " has been Archived" & Chr(10) & "Your document will now be set to the next revision #"
Me.Revision = Revision + 1
Me.LockCourse = 0
Me.RevisionDate = ""
Me.Model.SetFocus
Me.ArchiveCrsBtn.Enabled = False
End If
My code for the archive button...not on the warning form.
'DoCmd.OpenForm "frm_Archive_Warning", acNormal, "", "", acEdit, acNormal
'If [Forms]![frm_Archive_Warning]![Frame7] = 1 Then
I am not sure where to go from here. Will the code wait for the results of the Frame7. I do not have a default value for the frame so it all depends on which button is clicked. So, I don't want anything to happen until a button is clicked. If yes is clicked, I want to close the warning form and continue with the code below. If No is clicked I want to close the warning form and bypass the code below.
If Is_It_Archived = True Then
MsgBox "This record has already been archived"
Else
Dim Rev
Rev = Revision
'MsgBox Rev
DoCmd.SetWarnings WarningsOff
DoCmd.OpenQuery "qry_Archive_Main_Admin_To_ADB", acNormal, acEdit
DoCmd.OpenQuery "qry_Archive_Major", acNormal, acEdit
DoCmd.OpenQuery "qry_Archive_Minor", acNormal, acEdit
DoCmd.OpenQuery "qry_Archive_Media", acNormal, acEdit
DoCmd.SetWarnings WarningsOn
MsgBox "Revision " & Rev & " has been Archived" & Chr(10) & "Your document will now be set to the next revision #"
Me.Revision = Revision + 1
Me.LockCourse = 0
Me.RevisionDate = ""
Me.Model.SetFocus
Me.ArchiveCrsBtn.Enabled = False
End If