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
Solved

How do you create Radio Buttons in Access

Posted on 2014-07-27
10
338 Views
Last Modified: 2014-07-27
I need to create three radio buttons on a form.  Each will print a different report.

I've never done this so please provide step by step procedures.
0
Comment
Question by:J.R. Sitman
  • 4
  • 2
  • 2
  • +2
10 Comments
 
LVL 30

Accepted Solution

by:
hnasr earned 350 total points
ID: 40222399
Add Option group control to form - wizard starts
Add labels to option buttons
    report1
    report2
    report3
No default.
Values
    report1   1
    report2   2
    report3   3
Save values for later use
Option Buttons
Caption: Print Reports
Properties sheet: change name: printReports
   Event: After update
Private Sub printReports_AfterUpdate()
    Select Case printReports
        Case 1
            'print report1
        Case 2
            'Print report2
        Case 3
            'print report3
        End Select
End Sub

Open in new window

0
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 40222406
Putting the buttons in an option group (frame) will only allow you to click one of them at a time.

You may prefer to allow your users to run all three reports at one time and use a command button to initiate the printout based on whic items selected.  You can use option buttons without the frame by simply dropping them on your form, but if you want to allow multiple reports to be printed at the same time, I would generally use checkboxes rather than radio buttons
0
 
LVL 84
ID: 40222436
I'd agree with Dale regarding the use of Option Buttons (i.e. Radio Buttons). Radio Buttons, Checkboxes, etc are very common UI tools, and users expect them to behave in a certain way. If you make them do something they're not accustomed to - like using multiple Radio Buttons to allow for multiple choices - then you run the risk of a confusing interface.

According to most usage guides, Radio Buttons should be used when the user must make one (and only one) choice - like selecting Gender, for example.

If a user could choose one or more from a group of choices, you should instead use CheckBoxes.
0
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 

Author Comment

by:J.R. Sitman
ID: 40222608
Got it designed, except nothing happens when I select one of the buttons.  How do you get it to print?
0
 
LVL 35

Assisted Solution

by:PatHartman
PatHartman earned 100 total points
ID: 40222781
DoCmd.OpenReport ..........

Intellisense will guide you through the rest.  If you don't understand an option, use help.
0
 

Author Comment

by:J.R. Sitman
ID: 40222791
sorry, I don't understand.  I copied code from another print event and it doesn't work.. Can you edit it please?  

    Select Case optiontreatment
        Case 1
            'print rpttreatmentsadopters
            'DoCmd.OpenReport rpttreatmentsadopters
        Case 2
            'Print rpttreatments
            stDocName = "rptTreatments"
    DoCmd.OpenReport stDocName, acPreview, wherecondition:="[SoftSlip] = '" & Me.SoftSlip & "'"
   
    DoCmd.PrintOut Copies:=1
    DoEvents
    DoCmd.Close acReport, "rptTreatments"
        Case 3
            'print rpttreatmentsbilling
        End Select
0
 
LVL 84

Assisted Solution

by:Scott McDaniel (Microsoft Access MVP - EE MVE )
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 50 total points
ID: 40222844
Do you have an Option Group named "optiontreatment"? The code above basically looks at the value of that option group, and takes action accordingly. The only Option Group item that would cause a Print is Option 2 (whatever that is). If you have anything other than Option 2 selected in the optiontreatment group, the code would do nothing.
0
 

Author Comment

by:J.R. Sitman
ID: 40222902
got it.
0
 

Author Closing Comment

by:J.R. Sitman
ID: 40222903
Thanks
0
 
LVL 30

Expert Comment

by:hnasr
ID: 40223028
Welcome!
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

840 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