Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2006-07-02
11
Medium Priority
?
170 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
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…
Suggested Courses

618 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