473,386 Members | 1,743 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Option Groups

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
3 5961
Stewart Ross
2,545 Expert Mod 2GB
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
-Stewart
Oct 14 '08 #2
Thanks, worked a treat. A nice simple solution.
Oct 14 '08 #3
byronh
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 '*'"
Else
strSource = "='" & cboSource.Value & "'"
End If
' Build criteria string for Owner field
If IsNull(cboOwner.Value) Then
strOwner = "Like '*'"
Else
strOwner = "='" & cboOwner.Value & "'"
End If
' Build criteria string for Contract field
If IsNull(cboContract.Value) Then
strContract = "Like '*'"
Else
strContract = "='" & cboContract.Value & "'"
End If
' Build criteria string for Division field
If IsNull(cboDivision.Value) Then
strDivision = "Like '*'"
Else
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,
Byron
Jan 19 '09 #4

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

Similar topics

5
by: Saxman | last post by:
I created a text box labeled txtText1. The text box has a sample of text within. The Enabled property is set to False and the Multiline property set to True. I have four option buttons set...
5
by: Harry Haller | last post by:
<select name="cboPlaces" id="cboPlaces"> <option value="3">Countryside</option> <option value="4">Forest</option> <option value="5">Mountain</option> <option value="6">Desert</option> <option...
10
by: David | last post by:
Can anyone give me a quick code snippet (that is standards-based) for adding OPTION tags to a SELECT dynamically. I have no problem doing it in IE but I am kind of new to the whole standards world...
4
by: thomastk | last post by:
Hi, In the following script, I am trying to set selection to a select option element, that is newly created within the script. It works fine on IE installations on Windows 2000 and some XP...
4
by: Y Plas | last post by:
Hello all, i'm a new user in this group and was wandering if anyone could assisst me with a problem: I have a form with option groups within it outputig their results to a table called...
5
by: | last post by:
Hi guys, I have a form that I am using option groups on.. how can i make each option group a multi select ? thanks, kevin
20
by: PC Datasheet | last post by:
How can the label for a checkbox and the labels for the options in an option group be addressed? When a checkbox gets the focus, Access draws a dotted box around the label. When an option group...
7
by: sparks | last post by:
When you enter an option group you can move to each option with the arrow keys and select with the space bar. Option groups don't have keydown events so has anyone come up with a way to allow...
2
by: weston | last post by:
I have a form that has multiple option groups on it. When I created the form I copied the option groups and then changed the data source for them. But there now doesn't seem to be a caption for any...
2
by: ckrows | last post by:
I am attempting to create a report off of 6 option groups. Each option group is a Y or N response, populating a 1 or 2 in the tables. i want to report the number a word on the report, I chose the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.