Solved

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

Posted on 2006-07-02
11
162 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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
message box in access 4 51
Excel VBA, find a string in a column, update a cell 7 86
Problem to line 23 55
transition to visual .net from vb6 5 41
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

820 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