Solved

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

Posted on 2006-07-02
11
159 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
Comment Utility
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
Comment Utility
yes, which form to go to next from what I selected
0
 
LVL 18

Accepted Solution

by:
Crash2100 earned 500 total points
Comment Utility
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
 

Author Comment

by:lpetrowicz
Comment Utility
Thank you so much!  Very helpful information.    
0
 
LVL 18

Expert Comment

by:Crash2100
Comment Utility
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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

Author Comment

by:lpetrowicz
Comment Utility
Thanks again.
0
 

Author Comment

by:lpetrowicz
Comment Utility
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
Comment Utility
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
Comment Utility
Thank you so very much!!  Extrememly helpful!
0
 

Author Comment

by:lpetrowicz
Comment Utility
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
Comment Utility
It looks good to me, have you tried it yet?
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

744 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now