|
-
Feb 9th, 2000, 11:39 AM
#1
Thread Starter
New Member
Im trying to run this code but when I click the Yes or No buttons nothing happens.
If Me.Input = "UserInput" then
Msgbox "Click Yes to Continue No to cancel", vbyesno
If msgbox(vbyesno) = vbYes then
Me.Input = "UserInput"
Else
If msgbox(vbyesno) = vbNo then
Docmd.cancelevent
end if
end if
end sub
What I basically want to happen is that when a person clicks the Yes button a certain event occur and when he clicks No another event occur. At the moment I experiemented with the vbOKOnly and worked but not with vbYesNo, vbOKCancel etc.
What the hec am I doing wrong here?
Fouche
-
Feb 9th, 2000, 11:47 AM
#2
Lively Member
Try this
Code:
if msgbox("your question", vbYesNo) = vbYes then
....
else
....
end if
-
Feb 9th, 2000, 11:55 AM
#3
Member
Hi
You are using msgbox statement not the function. For your case you should use msgbox function.
Here is some sample try this.
Private Sub Command2_Click()
Dim result
result = MsgBox("Do You want to see the form", vbOKCancel, "message")
If result = vbOK Then
Unload Me
Form2.Show
Else
Cancel = True
End If
End Sub
Have a nice time
------------------
With regards,
Karun
-
Feb 9th, 2000, 12:59 PM
#4
Thread Starter
New Member
Originally posted by karunakaran:
Hi
You are using msgbox statement not the function. For your case you should use msgbox function.
Here is some sample try this.
Private Sub Command2_Click()
Dim result
result = MsgBox("Do You want to see the form", vbOKCancel, "message")
If result = vbOK Then
Unload Me
Form2.Show
Else
Cancel = True
End If
End Sub
Have a nice time
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|