Computing.Net > Forums > Programming > Code help in VB4

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.

Code help in VB4

Reply to Message Icon

Name: jackfrost5556
Date: February 14, 2005 at 11:06:18 Pacific
OS: 98SE
CPU/Ram: 166/64
Comment:

Hi one and all,
maybe someone can help a beginner with a problem in VB4.
The code below is an outline of a program I would like to write. As it sits, it runs fine. All code is in the one command button.
I've been thru my training manual, as well as VB help and can't seem to find a way to solve the problem.
After the line .......
If Combo1.text = "Visa" then......
I need a way to call some type of sub proceedure to place in text2. or call maybe form2 with it sized with the text already in it.
If I can find a way of adding the necessary amount of data for each item in the dropdown box, I'll be able to create the program as I want it.
But as it stands, I can't seem to get to there from here.No problem adding a module, class module or form to the program, Ijust can't find a way to add them into the program.
Thanks for your time. Any input would be greatly appreciated. Jack
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Private Sub Command1_Click()
If Text1.Text <> "black" Then
Dim returnvalue As Integer
returnvalue = MsgBox("Invalid password! Press YES to return to password box, or NO to exit program", vbYesNo + vbQuestion)
Select Case returnvalue
Case vbNo
End
Case vbYes
Text1.Text = ""
Text1.SetFocus
End Select
End If
If Text1.Text = "black" Then
If Combo1.Text = "Visa" Then
Text2.Text = "Visa is my number one card"
Else
If Combo1.Text = "mastercard" Then
Text2.Text = "Mastercard is my number two card"
Else
If Combo1.Text = "Discover Card" Then
Text2.Text = "Discover Card is my number three card"
End If
End If
End If
End If
End Sub



Just trying



Sponsored Link
Ads by Google

Response Number 1
Name: basicdos
Date: February 17, 2005 at 17:39:22 Pacific
Reply:

Do you want to read a seperate text file, that has been saved onto the hard drive into a second text box?
or do you want to save pre-written text like in a help file window ?

Look into these commands...
form1.Hide ....Makes this form invisible
form2.Show...Makes this form visible

create the form with the desired re written text or label on it then build it into the executable file'
work those hide or show form words into your code as appropriate within an if command


0

Response Number 2
Name: jackfrost5556
Date: February 18, 2005 at 09:41:09 Pacific
Reply:

Thank you, thank you. Works perfect. Why a 999 page training manual doesn't even address this basic concept, is beyond me.
Hope I don't have to come back for a while.
Have a good day Jack Hall


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: Code help in VB4

if u Need help in VB email me www.computing.net/answers/programming/if-u-need-help-in-vb-email-me/1201.html

Help in JAVA program www.computing.net/answers/programming/help-in-java-program/85.html

'Whats this Help' in vB www.computing.net/answers/programming/whats-this-help-in-vb/854.html