How to grab the value of a radio button in VBA

Lkwdmntr

Registered User.
Local time
Yesterday, 18:51
Joined
Jul 10, 2019
Messages
319
Hi guys,

I have three radio buttons (Screen, Print, PDF) that I am using to view, print, and save my reports. I am using nested if statements that look like this.

Code:
If Me.txtReportName = "Week at a Glance" Then
    If Me.rdbScreen.Value = True Then
        DoCmd.OpenReport "rptWeekAtAGlance", acViewPreview
    End If
        If Me.rdpPrinter.Value = True Then
            DoCmd.OpenReport "rptWeekAtAGlance", acNormal
            End If
End If

I haven't figured out how to save to PDF yet, but I'm getting an error "You've entered an expression that has no value"

Any ideas on how I can remedy this problem?
 
Last edited:
Use the wizard to create an option group.
 
Ok, I got it. I already had them as a group, I didn't realize they had a value of 1, 2, 3. Thanks! Now I need to figure out how to save the report as a pdf to my computer.
 
Been asked many times here.
Do a search here, or even a Google. No point guessing.
 

Users who are viewing this thread

Back
Top Bottom