chungtinhlak
12-08-2008, 11:27 AM
Hello Again, I have a Form with 3 Command Buttons (this form will be use as a message box). In a module, I want to say that if i click choice 1, do the following. Choice 2, do this.... How do this "code the Click"....
here is the example code
Sub Executive_Update()
Dim Answer As String
Dim MyNote As String
MyNote = "Do you want to update the Executive File? (Warning: Only authorized personnel)"
Answer = MsgBox(MyNote, vbQuestion + vbYesNo, "???")
If Answer = vbNo Then
'Code for No button Press
Exit Sub
Else
UserForm2.Show
If UserForm2.cmddaily_Click Then
UserForm2.Unload
MsgBox (Daily)
End If
If UserForm2.cmdweekly = True Then
UserForm2.Unload
MsgBox (weekly)
End If
If UserForm2.cmdcancel = True Then
Exit Sub
End If
MsgBox ("Complete")
End If
End Sub
here is the example code
Sub Executive_Update()
Dim Answer As String
Dim MyNote As String
MyNote = "Do you want to update the Executive File? (Warning: Only authorized personnel)"
Answer = MsgBox(MyNote, vbQuestion + vbYesNo, "???")
If Answer = vbNo Then
'Code for No button Press
Exit Sub
Else
UserForm2.Show
If UserForm2.cmddaily_Click Then
UserForm2.Unload
MsgBox (Daily)
End If
If UserForm2.cmdweekly = True Then
UserForm2.Unload
MsgBox (weekly)
End If
If UserForm2.cmdcancel = True Then
Exit Sub
End If
MsgBox ("Complete")
End If
End Sub