By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,534 Members | 2,223 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,534 IT Pros & Developers. It's quick & easy.

Option Groups

P: 2
Is there anyway of returning the value of an option group (in access 2003) back to what it was before any entry was made? I frequenty find people are wishing to remove there answer but with an option group it seems as if once you have made a choice, although you can change the choice, there is no way of returning it to its original state of having nothing selected. I know I can do this with a combo box by simply deleting the entry but I was hoping it could also be done with an option group. Any help appreciated
Oct 14 '08 #1
Share this Question
Share on Google+
3 Replies

Expert Mod 2.5K+
P: 2,545
Hi BarbaraB, and Welcome to Bytes!

Depending on what you want to do there are several ways to revert the option group back. One is to reset the value of the option group to the DefaultValue property of the frame concerned. You can test this by placing the following line in the On Click code of a suitable button:

Expand|Select|Wrap|Line Numbers
  1. me![name of your option group] = me![name of your option group].DefaultValue
You can also clear the option group completely (no default choice displayed) by setting it to null:

Expand|Select|Wrap|Line Numbers
  1. me![name of your option group] = Null
Oct 14 '08 #2

P: 2
Thanks, worked a treat. A nice simple solution.
Oct 14 '08 #3

P: 1
Hi, first time posting here and hope this question hasn't already been answered elsewhere. Got frame and option group help from Martin Green's Access Tips to create an action tracking option group to filter records for a report.

The options for the "Apply Filter" button for filtering on the Action Status are: Open, Closed, Late, Overdue and All.

Everything works fine for the filter except that for viewing Open actions, I would like to see both Open and Overdue actions as no action can be Overdue (for closure) without also being Open.

I have amended the Martin Green code accordingly and here it is below:

Private Sub cmdApplyFilter_Click()
Dim strSource As String
Dim strOwner As String
Dim strContract As String
Dim strDivision As String
Dim strStatus As String
Dim strFilter As String
' Check that the report is open
If SysCmd(acSysCmdGetObjectState, acReport, "rptMainData") <> acObjStateOpen Then
MsgBox "You must open the report first."
Exit Sub
End If
' Build criteria string for Source field
If IsNull(cboSource.Value) Then
strSource = "Like '*'"
strSource = "='" & cboSource.Value & "'"
End If
' Build criteria string for Owner field
If IsNull(cboOwner.Value) Then
strOwner = "Like '*'"
strOwner = "='" & cboOwner.Value & "'"
End If
' Build criteria string for Contract field
If IsNull(cboContract.Value) Then
strContract = "Like '*'"
strContract = "='" & cboContract.Value & "'"
End If
' Build criteria string for Division field
If IsNull(cboDivision.Value) Then
strDivision = "Like '*'"
strDivision = "='" & cboDivision.Value & "'"
End If
' Build criteria string for Status field
Select Case fraStatus.Value
Case 1
strStatus = "='Open'"
Case 2
strStatus = "='Closed'"
Case 3
strStatus = "='Late'"
Case 4
strStatus = "='Overdue'"
Case 5
strStatus = "Like '*'"
End Select
' Combine criteria strings into a WHERE clause for the filter
strFilter = "[Contract] " & strContract & " AND [Source] " & strSource & " AND [Owner] " & strOwner _
& " AND [Division] " & strDivision & " AND [Status] " & strStatus
' Apply the filter and switch it on
With Reports![rptMainData]
.Filter = strFilter
.FilterOn = True
.txtReportSubtitle.Value = _
"Division: " & cboDivision.Value
End With

All assistance much appreciated,
Jan 19 '09 #4

Post your reply

Sign in to post your reply or Sign up for a free account.