msg box that runs a code

Clod_13

Registered User.
Local time
Today, 05:03
Joined
May 28, 2014
Messages
15
Hi guys, I have a little problem in creating a msg box that then activate a code
How can I do?
I was doing
Private Sub Chiusura_Pratica_Click()
MsgBox "Bla Bla Bla " _
VbMsgBoxStyle.vbYesNo
If Response = vbYes Then
Me.Stato.Value = "A Scadere"
Me.Assegnato_a.Value = ""
Else
MyString = "No"
End If


End Sub
but it doesn't work... any ideas?
 
try this


Code:
Private Sub Chiusura_Pratica_Click()
dim Response as VbMsgBoxResult

Response = MsgBox "Bla Bla Bla ", vbYesNo

If Response = vbYes Then
      Me.Stato.Value = "A Scadere"
      Me.Assegnato_a.Value = ""
Else
    MyString = "No"
End If


End Sub
 
Code:
Private Sub Chiusura_Pratica_Click()
    Dim MyString As String
    If MsgBox("How about some Code indenting?", vbYesNo + vbQuestion) = vbYes Then
        Me.Stato.Value = "A Scadere"
        Me.Assegnato_a.Value = ""
    Else
        MyString = "No"
    End If
End Sub
 
Thank you so much... the second one worked perfectly!
 

Users who are viewing this thread

Back
Top Bottom