msg box vbCritical help

C

Chad

Hello, I am using the code below for a button that runs a query and resets
all controls on my form. Everything works but I wanted to use vbCritical in
the message box and I cant figure it out. Thanks!


Private Sub cmdDeleteCoilId_Click()
Dim strMsg As String

DoCmd.SetWarnings False '--------------------------Set all Warnings to false
or turns them off

strMsg = "Are you sure you want to delete these entries?" & Chr(13) & _
"" & Chr(13) & _
"NOTE: All data for these Coil ID(s) will be deleted if yes is
selected!!!"

If MsgBox(strMsg, vbYesNo) = vbYes Then

DoCmd.OpenQuery "qrySlitterSetUp" '-----------Runs delete query

'---------------------------------------------Clears text boxes
txtCoilID1.Value = ""
txtCoilID2.Value = ""
txtCoilID3.Value = ""
txtCoilID4.Value = ""
txtCoilID5.Value = ""

txtCoilWeight1.Value = 0
txtCoilWeight2.Value = 0
txtCoilWeight3.Value = 0
txtCoilWeight4.Value = 0
txtCoilWeight5.Value = 0

txtMasterCoilWidth.Value = 0

txtNumberOfCuts1.Value = 0
txtNumberOfCuts2.Value = 0
txtNumberOfCuts3.Value = 0
txtNumberOfCuts4.Value = 0
txtNumberOfCuts5.Value = 0
'--------------------------------------------Clears combo boxes
cboSlitWidth1.Value = Null
cboSlitWidth2.Value = Null
cboSlitWidth3.Value = Null
cboSlitWidth4.Value = Null
cboSlitWidth5.Value = Null

cboGauge.Value = Null

Forms![frmMain].Requery '------------------Requerys the frmMain
Forms![frmMain].Refresh '-----------------Refreshes the frmMain
DoCmd.SetWarnings True '----------------Sets Warnings back to true
Else
DoCmd.SetWarnings True '----------------Sets Warnings back to true if
no was selected
End If

End Sub
 
F

fredg

Hello, I am using the code below for a button that runs a query and resets
all controls on my form. Everything works but I wanted to use vbCritical in
the message box and I cant figure it out. Thanks!

Private Sub cmdDeleteCoilId_Click()
Dim strMsg As String

DoCmd.SetWarnings False '--------------------------Set all Warnings to false
or turns them off

strMsg = "Are you sure you want to delete these entries?" & Chr(13) & _
"" & Chr(13) & _
"NOTE: All data for these Coil ID(s) will be deleted if yes is
selected!!!"

If MsgBox(strMsg, vbYesNo) = vbYes Then

DoCmd.OpenQuery "qrySlitterSetUp" '-----------Runs delete query

'---------------------------------------------Clears text boxes
txtCoilID1.Value = ""
txtCoilID2.Value = ""
txtCoilID3.Value = ""
txtCoilID4.Value = ""
txtCoilID5.Value = ""

txtCoilWeight1.Value = 0
txtCoilWeight2.Value = 0
txtCoilWeight3.Value = 0
txtCoilWeight4.Value = 0
txtCoilWeight5.Value = 0

txtMasterCoilWidth.Value = 0

txtNumberOfCuts1.Value = 0
txtNumberOfCuts2.Value = 0
txtNumberOfCuts3.Value = 0
txtNumberOfCuts4.Value = 0
txtNumberOfCuts5.Value = 0
'--------------------------------------------Clears combo boxes
cboSlitWidth1.Value = Null
cboSlitWidth2.Value = Null
cboSlitWidth3.Value = Null
cboSlitWidth4.Value = Null
cboSlitWidth5.Value = Null

cboGauge.Value = Null

Forms![frmMain].Requery '------------------Requerys the frmMain
Forms![frmMain].Refresh '-----------------Refreshes the frmMain
DoCmd.SetWarnings True '----------------Sets Warnings back to true
Else
DoCmd.SetWarnings True '----------------Sets Warnings back to true if
no was selected
End If

End Sub

If MsgBox(strMsg, vbCritical + vbYesNo ) = vbYes Then
 
Top