Computing.Net > Forums > Programming > VB4 Multiple message box syntax

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

VB4 Multiple message box syntax

Reply to Message Icon

Name: jackfrost5556
Date: January 30, 2005 at 11:33:40 Pacific
OS: 98SE
CPU/Ram: 166/64
Comment:

Hi all,
I've run into this stupid problem in VB4. Gotten along pretty well with it but this problem has me stumped.
Neither my 1,000 page (sic) training manual, or VB help has resolved the problem. I've spent a week on it and I can't come up with the right syntax.
The problem is, I want to be able to use a multiple
message box and can't get there, I.E. By selecting the retry button to do just that, or cancel to close.
I've cleaned this up, so no bad commands are in it.
As you see it, it works fine, except for the inability to use the multiple message box.(Either button resets it to a clean text box)
This is on form1 with one text box, and one command Button. .....
...................................................
Private Sub Command1_Click ()
if text1.text = "black" then
Msgbox "Good Password"
else
MsgBox "Bad Password ! Try Again ??", vbRetryCancel
Text1.Text = ""
Text1.SetFocus
End If
End Sub
..................................................
Thanks in advance for any help Jack


Just trying



Sponsored Link
Ads by Google

Response Number 1
Name: Chi Happens
Date: February 1, 2005 at 05:22:21 Pacific
Reply:

hmmm, it works fine in vb6...just out of curiosity...why vb4?

Chi

Happy Decemberween, Everybody!


0

Response Number 2
Name: jackfrost5556
Date: February 1, 2005 at 11:59:16 Pacific
Reply:

Hi Chi,
Thanks for responding. VB4 in my second computer with windows 95. Mainly a price thing, and I'm just learning.
The vbokcancel as you know, has 2 buttons.
Pressing ok does what I want. Takes me back, clears the text box for re-entering the password. Unfortunetly, the cancel button does the same thing, and I don't know how to write the code to close the program, with that selection, and can't find it anywhere.


Just trying


0

Response Number 3
Name: jackfrost5556
Date: February 8, 2005 at 11:51:27 Pacific
Reply:

Well Chi,
Like I said i wouldn't in VB4. Did some digging and, at least in VB4 it does.
All message boxes and icon options. The following is just the syntax, not the true program...
............................................
Private Sub Command1_Click()
If Text1.Text <> "black" Then
Dim standard As Integer
standard = MsgBox("Invalid password. Press yes to return to password box or no to exit program", vbYesNo + vbExclamation)

Select Case standard
Case vbNo
End
Case vbYes
Text1.Text = ""
Text1.SetFocus
End Select
End If
If Text1.Text = "black" Then
if combo1.text = "Mastercard then
Text2.Text = "good job" (real text would be here)

End If
End If

End Sub

( I used the word "standard". I assume any word that is not a functioning word in vb is O.K.
The default word would be "returnvalue" )

Just trying


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: VB4 Multiple message box syntax

VB message box www.computing.net/answers/programming/vb-message-box/4343.html

VB Message Box Title www.computing.net/answers/programming/vb-message-box-title/5066.html

Message box won't stop poping up www.computing.net/answers/programming/message-box-wont-stop-poping-up/9004.html