Help referring to an Option Group Value

reginab

Registered User.
Local time
Today, 11:55
Joined
Nov 3, 2005
Messages
10
I have 2 option groups on a form. The first option group allows a user to pick from a list of reports and the second option group lets them choose between a detail or a summary report. However, there are 3 reports that have no corresponding summary reports so I'd like to turn off the summary option. I put this code on the "Click" event

Me.RptSelect.Controls(1).Enabled = True or
Me.RptSelect.Controls(1).Enabled = False

this works fine as long as control #1 isn't already selected. I tried moving the focus to Control 2 whenever an option is selected but I couldn't get the code right.

I know I could take the options out of the group and that would work but there must be a way to get this to work without doing that.

Help would be appreciated.
 
Last edited:
Just use the frame value, not the individual options within the frame:
Code:
fraYourOptionGroupFrameName.Value = 2
 
I would use the AfterUpdate Event for your first framed group of radios. In that event just write code to test the frame's value, and if the value matches one of the reports without a summary, you set your other framed group of radios enabled property to false, if it has a summary, you set the groups enabled property to true. Don't forget when you finally do the call to run the report that you test to see if the summary control is enabled or not as well to run/not run it.


Code:
Private Sub frmReports_AfterUpdate()
Select Case frmReports
    Case 1, 2, 3
        frmReportType.Enabled = False
    Case 4, 5, 6
        frmReportType.Enabled = True
End Select
End Sub
 
Thank you, this looks like it might be the best option although the other one works too.
 

Users who are viewing this thread

Back
Top Bottom