msg "are you sure" onClick check box.

carlchapman

Registered User.
Local time
Today, 03:02
Joined
Jul 25, 2006
Messages
29
Hi, sorry but i have a new issue. Ok, here it goes.

I have a check box on my form that "black lists" that related record. I wish to warn the user that when they click/after update the check box, they will no longer be able to work with this contact unless an administrator unblocks the record.

Here is the VBA for what i have done so far.

Private Sub orgMisc_AfterUpdate()
Dim intAnswer As Integer
intAnswer = MsgBox("Are you sure you wish to Black List this contact?" _
, vbQuestion + vbYesNo, "Time Saver")
If intAnswer = vbYes Then
orgMisc = True
Else
orgMisc = False
End If
End Sub

This works fine except for 1 problem. It prompts me if i change my mind and uncheck the check box. So basically, if (default) is False Then OnClick i want the above VBA to execute. If the check box already isset to TRUE then ignore the above VBA and orgMisc (checkbox) change to FALSE.

If any 1 can offer advice or knows how to solve this issue, that would be great :)
 
Imbed your msgbox in an IF that checks the value of the box currently
 
Why not simplify your method to an If MsgBox?

Code:
If orgMisc = False then
    If MsgBox("Are you sure you wish to Black List this contact?", vbQuestion + vbYesNo, "Time Saver") = vbYes Then
        orgMisc = True
    Else
        orgMisc = False
    End If
End If
 
Last edited:

Users who are viewing this thread

Back
Top Bottom