I have an executive level report based on a query (A) that displays a list of project update briefing due dates. This is all well and good provided the staff properly enters the project update due date in the table record. If the due date is not entered then the project (and its required update briefing) is not included in the report.
To prevent that, I created a second query (B) that includes both projects with a future due date and project where no due date is defined.
I wanted the report to open showing results of query B and include a method to toggle the displayed results between query A and B.
I was able to do that with a button on the report:
Private Sub cmdToggleView_Click()
If Me.cmdToggleView.Caption = "Click to Filter List" Then
Me.cmdToggleView.Caption = "Click to Show Full List"
Me.RecordSource = "qryA"
Me.Requery
Else
Me.cmdToggleView.Caption = "Click to Filter List"
Me.RecordSource = "qryB"
Me.Requery
End If
lbl_Exit:
Exit Sub
End Sub
It worked flawlessly.
Now, I thought a better design would be to have a pair of option buttons where the default value would be the Full List (qryB) and the user could click the "A" option to toggle the
Private Sub frmToggleView_Click()
If Me.frmToggleView.Value = 1 Then
Me.RecordSource = "qryA
Me.Requery
Else
Me.RecordSource = "qryB"
Me.Requery
End If
lbl_Exit:
Exit Sub
End Sub
This method works as well, but the option buttons appear dimmed (neither are displayed as selected or not selected) and they don't change state when clicked.
What am I doing wrong?
Thank you.