|
-
Mar 7th, 2000, 10:59 PM
#1
Thread Starter
Lively Member
Fro some reason this code will not work where I have it. it is just a message box with yesno and when yes is no is clicked I want it to exit the sub. Am i missing something:
Dim iAnswer As Integer
MsgBox "Did You Save Your New Changes?", vbYesNo + vbInformation, "Close Inventory History Page"
If iAnswer = vbno Then
Cancel = True
Exit Sub
End If
-
Mar 7th, 2000, 11:07 PM
#2
Member
Try this:
Code:
Dim iAnswer As Integer
iAnswer= MsgBox "Did You Save Your New Changes?", vbYesNo + vbInformation, "Close Inventory History Page"
If iAnswer = vbno Then
Cancel = True
Exit Sub
End If
-
Mar 7th, 2000, 11:27 PM
#3
PowerPoster
Why we need the iAnswer?
If MsgBox("Did You Save Your New Changes?", vbYesNo + vbInformation, "Close Inventory History Page") = vbNo Then
Cancel = True
Exit Sub
End If
Try this:
Code:
Dim iAnswer As Integer
iAnswer= MsgBox "Did You Save Your New Changes?", vbYesNo + vbInformation, "Close Inventory History Page"
If iAnswer = vbno Then
Cancel = True
Exit Sub
End If
-
Mar 8th, 2000, 08:34 AM
#4
Member
Hai VBAmateur,
You are using msgbox statement it will not return
any values.
what chris is saying is correct.Chris is using a msgbox
function.From that only you can expect a value ,to react
accordingly.
Dim response 'declare a variable to hold the value.
response=msgbox(-------------)
if response=vbyes then
--do something
else
cancel=true
end if
thanks
karun
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
|