Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
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

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 visiblecreate 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

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

![]() |
![]() |
![]() |

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