Robert Saye
Registered User.
- Local time
- Today, 16:54
- Joined
- Jun 19, 2000
- Messages
- 49
Hello all,
I have two subforms on my main form. One subform has a check box on it, when the user checks it, I would like to open a msgbox asking if they are sure. (A append and delete query fire off at main form close). I would like the msgbox to open and then if they click yes to run my 2 queries (instead of at form close). I have the following code in the subform:
Private Sub CheckWhenComplete_BeforeUpdate(Cancel As Integer)
'If the user really meant to check the box, then run append & delete queries
Dim strMessage As String
Dim intOptions As Integer
Dim bytChoice As Byte
If CheckWhenComplete = 1 Then
strMessage = "Did you complete Action Item? This will cause the line to be deleted and sent to the comments table."
intOptions = vbQuestion + vbOKCancel
bytChoice = MsgBox(strMessage, intOptions)
If bytChoice = vbCancel Then
CheckWhenComplete.SetFocus
Cancel = True
End If
End If
End Sub
I have two subforms on my main form. One subform has a check box on it, when the user checks it, I would like to open a msgbox asking if they are sure. (A append and delete query fire off at main form close). I would like the msgbox to open and then if they click yes to run my 2 queries (instead of at form close). I have the following code in the subform:
Private Sub CheckWhenComplete_BeforeUpdate(Cancel As Integer)
'If the user really meant to check the box, then run append & delete queries
Dim strMessage As String
Dim intOptions As Integer
Dim bytChoice As Byte
If CheckWhenComplete = 1 Then
strMessage = "Did you complete Action Item? This will cause the line to be deleted and sent to the comments table."
intOptions = vbQuestion + vbOKCancel
bytChoice = MsgBox(strMessage, intOptions)
If bytChoice = vbCancel Then
CheckWhenComplete.SetFocus
Cancel = True
End If
End If
End Sub