Solved

How do I make forms connect using radio buttons and a continue button

Posted on 2006-07-02
11
161 Views
Last Modified: 2010-04-30
I have four forms in VB 6.  I have radio buttons on each and a continue button as well.  I am looking to know how to make each radio button on the form go to one of the other three forms.  I guess this may be a coding question.  Thank you in advance for your assistance.
0
Comment
Question by:lpetrowicz
  • 6
  • 5
11 Comments
 
LVL 18

Expert Comment

by:Crash2100
ID: 17028272
What do you mean, make it "go to one of the other three forms".  Do you want the other form to be able to know what you selected?  Or make it decide which form to show next, depending on what you selected?
0
 

Author Comment

by:lpetrowicz
ID: 17028597
yes, which form to go to next from what I selected
0
 
LVL 18

Accepted Solution

by:
Crash2100 earned 500 total points
ID: 17028631
Do you want them to select something, then click the continue button to proceed?  If so, then you should do something like this:

First create a Frame object to put your radio buttons in (this will make it so only one of the radio buttons can be selected at a time).  Then draw your radio buttons INSIDE of the frame.

Now just put some code similar to this to tell it what to do depending on which option is selected:

Private Sub Command1_Click()
    Me.Hide  'hides the current form

    If Option1.Value = True Then Form1.Show
    If Option2.Value = True Then Form2.Show
    If Option3.Value = True Then Form3.Show
End Sub
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

Author Comment

by:lpetrowicz
ID: 17028650
Thank you so much!  Very helpful information.    
0
 
LVL 18

Expert Comment

by:Crash2100
ID: 17028664
I'm glad I could help!  If you need any help implementing this into your program, feel free to post a comment and I'll try and walk you though it.
0
 

Author Comment

by:lpetrowicz
ID: 17028667
Thanks again.
0
 

Author Comment

by:lpetrowicz
ID: 17031037
I am so new to this I must ask.  Where you have "Command1" in the code, is that what it should say or should it read what I actually have on the button?  The same question with Option1 and Form1.  Thank you again for any assistance.
0
 
LVL 18

Expert Comment

by:Crash2100
ID: 17031211
It doesn't have to say that, just assume you insert whatever you name the button you create, wherever I put "Command1".  Usually you give it a name that has something to do with it's function, since you want it to be called "continue", it would likely be named "cmdContinue" (the cmd is because it's a command button).

You can do the same thing with the option buttons and the forms.  Option button names usually begin with "opt" and form names with "frm".
0
 

Author Comment

by:lpetrowicz
ID: 17031395
Thank you so very much!!  Extrememly helpful!
0
 

Author Comment

by:lpetrowicz
ID: 17031478
Let me make sure I have this then, please.  I have three forms named Form1, Form2 and Form3.  On Form1 I have two radio buttons that are labeled A and B.  I also have a command button named Next.  I want to be able to select either radio button and hit Next to go to one or the other.  Is this the proper code below?

Private Sub cmdNext_Click()
    Me.Hide "hides the current form

    If optA.Value = True Then Form2.Show
    If optB.Value = True Then Form3.Show
End Sub
0
 
LVL 18

Expert Comment

by:Crash2100
ID: 17033115
It looks good to me, have you tried it yet?
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question