Option Group: How To Store Selected Button?

Aug 25, 2005


On my form I have an option group with 4 radio buttons. Depending on the button selected certain fields become visible. This works all fine. Problem is though that I don't know how to store the selected value. At the moment, every time you open the form you have to select the same button to see the info stored in the fields that become visible. I guess that I'll have to somehow store the value for the selected buttons in the table. But How? Do I refer to the frame and store the value corresponding to the number of button (1, 2, 3 or 4) or do I store the balue for each button seperately?
I've played with it for too long now and cannot find the golden tip. Please advice.



View Replies


Store Value For An Option Group?

Nov 15, 2005

Hello Everyone,

I'm not sure if this is possible. I have a form (link to a table) with option boxes that when I click on one of the option boxes sets a value to a field in the table. The problem is that when I check a different option box I have to manually uncheck the other option box that was previously checked. Is there a way to have this done automatically? Meaning that if I check box 1 and then box 2, when I check box 2, then box 1 has to get Unchecked.

I also tried using a group option with different option boxes and that seems to work fine as far keeping only one option box checked, but don't know how to make the checked box to store its value to a table. Please help!

View 14 Replies View Related

How To Use Option Button To Store Value Into Table

Dec 9, 2013

I want to make option button in access to allow user choose status like: Single, Married and Widower


When user choose the value must save into table. How to do this?

View 4 Replies View Related

Forms :: Option Group With Command Button

May 31, 2015

I'm using option group with value 1 and value 2 with a command button to open two different forms. This is the code:

Private Sub Command9_Click()
Dim strForm As String
Select Case Me.Cornice0
Case Is = 1

[Code] ....

I would like to close form's option group once clicked the command button after the opening of the requested value form. I tried Docmd.close but all I get is the option group no more working.

View 4 Replies View Related

Modules & VBA :: Disabling Option Group If A Button Is Pressed

Jun 16, 2014

I have an option group with 2 buttons in it, yes and no. It is set to default to No, but if someone hits Yes I want it to enable or turn on the next option group. Would just simply changing visible status disable it? Because I have a series of codes set up based on the second option group which read as:

Private Sub NumberOfAdditionalSites_Option1_GotFocus()
Me.AdditionalSitesLabel1.Visible = True
Me.AdditionalSitesText1.Visible = True
End Sub

[Code] .....

I do not want these to be visible if the initial option group is still set to no.

View 4 Replies View Related

Forms :: Option Group - Warn User When Neither Of 2 In Option Group Not Ticked?

Jul 25, 2013

I stumbled upon the Option Group function just yesterday and, happy as a clam, I created a group with 2 options in radio button style. I assigned the values to a field called Registration_Type as the 2 options are "Confirmed Registrants" and "Prospective Attendees".

[Great. That part works well. When I look at the table, a 1 or a 2 is in that field so it's great to know how to control accidental ticking of radio buttons (previous 450 records or so didn't have this option group functionality so one might easily tick one of the buttons. So one part of controlling option group I know I can handle via the table itself for now.]

The challenge is how to ensure the user always ticks one or the other ... I went back to the main table and tested the 'required entry' option for the Registration_Type field but forcing an action like this is not ideal in my mind. The usual error message vagueness for the average user is no good and I don't want to limit the user so much.

Is there a way to simply have a popup come up warning that neither radio button was ticked? Perhaps something linked to the form - i.e., maybe "after update"?? I only learned about attaching code to before and after update on controls a couple of days ago, so not sure if this would be best approach.

Just something to let the user know that nothing has been ticked in the option group as that controls in which of 2 reports the data will show up in so any record not ticked might mean a registrant being left out, which would be rather disastrous <g>.

View 1 Replies View Related

Create Check Boxes/Option Buttons/Option Group Using VBA

Mar 14, 2008

I’m really stuck on how to create: Check Boxes/Option button/Option Group in VBA.

Could someone help on either all of them or some of them please?



View 2 Replies View Related

Blank Option (radio) Buttons In Option Group

Aug 18, 2006

I am using an Access database for a foreign language dictionary project.

One of the forms I use is populated by a query (qryLemmaTable) to retrieve information from tblLEMMA.

This form works precisely as I intend it to work, but there is a glitch on it that is driving me mad.

The form in question has an option group with 11 radio buttons that correspond to the parts of speech associated with each word in tblLEMMA.

When I click on the button optAdjective I apply a filter and the only records that are displayed are adjectives. (The same applies for Nouns, Verbs, Prepositions etc.)

Here is the glitch: even though the radio buttons apply the filter correctly, no “black spot” appears in the button. Other signals on the screen let me know what word type is selected, so I can accomplish what I want, but I want the “black spots” too!

Perhaps this will be a clue: For each radio button I use the following code in the GotFocus event.
Me.FilterOn = False
Me.Filter = "wordtype = 'A'" ‘(or N, etc)
Me.FilterOn = True

And this for the Lost Focus event
Me.FilterOn = False

Thanks for the help.

View 3 Replies View Related

Select Option Group Option Based On Checkbox Value

Aug 22, 2005


I've got an Option Group with 3 options; Yes, No and Future.

I also have a range of Check Boxes; 1 for every day of the week.

When one of the check boxes is selected I want the Option Group to change to Yes.

Currently, the Option Group defaults to Future and No will only be available by manually selecting it. This doesn't need to be changed.

Any help will be greatly appreciated!


View 2 Replies View Related

How To Store Selected Songs Ids In Db?

Feb 18, 2006

Hi all i have a db for my music collection. It has one table with the following feilds on it:

ID|filename|artist|album|title|track|comments|genr e|seconds|filesize|bitrate

I already created pages that with checkboxes that user select indvidual songs and by click of play button it goes and plays those songs for me.

Now i created another button next to play that it supposed to write the selected songs to db and save the ids of slected songs.Note: i use song ids to pull indvidual songs from db to be played by my song player!

My problem is i do not how to design a few tables that keep track of selected songs for each user along with the name of playlist for each user!! In processs i do not want to modify my current table i just want to add more tables to help me achive what i want. I be happy if an expert tell me how i can create tables that store play list(selected songs)info for each user and later i be able to query them easily in order to pull out playlist of each user.Thanks

View 3 Replies View Related

Modules & VBA :: Using Array To Store Selected Items In List Box

Apr 10, 2015

I want to use an array to store data from a list box into a variable. I want it to be able to store one value, or multiple values, depending on what is selected.

Main problem: this list box feeds off a table which has employee names and their e-mails. The list box itself only shows the names, and when I select what I want the array to store is their e-mails, not their names.

Dim strNames As String
Dim varItem As Variant
Dim intCount As Integer
For Each varItem In Me.lstNames.ItemsSelected
intCount = intCount + 1
Select Case Len(strNames)

[Code] ....

That code successfully displays the item I selected, but only displays the name. I need to make it look in the table and get me column #2. I also want it to be able to select more than one item at a time.

View 5 Replies View Related

Modules & VBA :: Store Path Location Selected By User To A String

Feb 7, 2014

I am using this code

DoCmd.OutputTo acOutputReport, "rptFilter", "Excel97-Excel2003Workbook(*.xls)", strFilename, True, "", , acExportQualityScreen

With the OutputFile set to "" so the user can select the directory on where they want to store the exported template. I'm trying to figure out if I could get the file path and the file name and store it on a string so I could use it for something else.

View 4 Replies View Related

Option Group

Mar 3, 2005

At present I have a form which is used to select a date range then using one of three buttons I can select one of three reports. I want to use an Option Group with three options to replace the three buttons. I have fiddled around using three separate Option Buttons and they work ok but in my opinion they are not the way to go. I need some assistance with the code as the Option Group is slightly different to the Option Buttons.

View 5 Replies View Related

Help Option Group

Jul 19, 2005

I have a very simple option group, status 1, 2 , 3 or 4. When the status of the group is changed i have the following code used to label txtStatusChangeAudit which lables who changed it based on the log in name. I have this code for each of the four options. The code works great but when i leave the form and come back to it the txtStatusChangeAudit that holds the code is now blank. When i click an option it again shows the information i want.

How do i get the form to save this information so when i leave the form and come back to it the last person to change the status will still be present?

Private Sub OpenOptionButton_GotFocus()
Me.StatusChangeAudit = "Status Open By; " & User.UserName & Space(1) & (Now)
End Sub

Thanks a million..


View 1 Replies View Related

Value Of Option Group

Jul 30, 2005

This should be an easy one.... I had an existing form. Needed a second form. But the two were so close I just added and option group to make certian fields visible when that option was picked. Now.... The problem is sorting or doing a query by the value of the option group. What I am thinking is I need to store the value of the option to a field. ie My option group is named "PickWO" the value is "1" or "2", so I added a field to my WO table... so how do I store the value of "1" or "2" to the new field? Hope this makes sense!

View 9 Replies View Related

Option Group

Dec 20, 2006

I have created an option group. There is a question and the response is yes, no or N/A. If the answer is no or N/A then I want to skip to the next question. If the answer is yes then I want to ask a follow up question. How would I make it so that when the answer is no or na and the user hits tab it would skip right over the follow up portion and move on to the next question?

View 1 Replies View Related

Option Group / Message Box

Aug 28, 2007


I have a option group with several buttons. Is it possible to apply a msgbox to one of the buttons where it will ask the user "Are you sure you want to generate report to excel". I would like the user click ok to continue or cancel. I am not sure how to get this message box prior to the code running when the option button is pressed. Thanks you for your time.

View 8 Replies View Related

Option Group Nulls Out

Feb 7, 2005

Will someone look at my option group in my form (frmcustomer) and help me figure out why the option group selections for existing records nulls out (visually you cannot see which button had been previously selected).

The option group is working fine in that it is adding the appropriate selection to the record, but when you open the form up in edit mode the selection has been grayed out.

View 1 Replies View Related

Option Group Question

Mar 18, 2005

I have an Option Group with 3 choices...1,2 and 3. The default value is 2 as setup in the table default value setting.
I have a subform that has a check box and when checked I want the Option Group value to be "1" otherwise I want the default value of "2" or "3" to remain in the table. I can get all this to work through a Afterupdate code in the subform check box except the part where I want the value left at what
ever was in the option group part. Here is my code...

Private Sub Paperwork_Returned_AfterUpdate()
If Me.Paperwork_Returned = "yes" Then
Me.Parent.paperworkstatus = "1"
Me.Parent.paperworkstatus = False
End If
End Subvalue

I think the problem is in the "Else" part. The if trus seems to work but if false it will not leave the previouse value in the field.

This last little thing is the last thing I need to finish up. This board has taught me so much...most of all it has taught me that when somebody ask me if I am an advanced access user, I will have to say is anyone? This program is so powerful and I can take a lifetime to master, or so it seems.

Thank you!

View 1 Replies View Related

Option Group Problem

Jun 1, 2005

I have an option group set up on my form that represents four different sheets. I want to be able to select one and have a certin function occur (docmd.openquery) according to which button is selected. Any ideas? :confused:

View 1 Replies View Related

Option Group Validation

Sep 23, 2005

I have an option group, with two options buttons. I need to to be a required field. (I cant) make this required at the table level, as there are already 56K records).

I've tried on the before update on the form, making the frame tag = required. For some reason this is not working. Any idea's

Dim blnContinue As Boolean
Dim ctl As Control
blnContinue = True
For Each ctl In Me.Controls
If ctl.Tag = "Required" Then
If IsNull(ctl) Then
MsgBox "Required Information Missing", vbCritical + vbOKOnly + vbDefaultButton1, "You must fill in the field indicated with red"
Cancel = True
Exit For
End If
End If
Next ctl
Set ctl = Nothing
End Sub

View 5 Replies View Related

Using Option Group For Yes/No Fields

Oct 13, 2005

Hi, all--
Perhaps a silly question:

I want to use an option group with a seperate check box for yes and no for a series of yes/no fields. I find that when I do this, once a record is started all have these items have "no" checked. I tried defaulting the value to null and other such things, but to no avail.

Any ideas (while retaining the concept)?



View 1 Replies View Related

Need Null For Option Group!

May 11, 2006

I thought this would be easily found by searching the forum! But I had no luck.
Having trouble with an Option Group. I have an option group with 2 options, YES and NO. Value of Yes set to -1 and value of No set to 0. The field this is bound and is set to Yes/No. The problem is.... No matter what I try it keeps assigning a value to this field in my form! The option group is the last item on the form. Date being the first..... After you enter a date, and an auto number is created, it gives the option group a value of YES or "-1" There is nothing in the default value of the radio button, the frame, or the field to which it is bound. Why is this assigning a value and how can I stop it???? This group needs to remain blank to force the user to THINK before it has a value.
I have managed to get around this by changing the bound field to "Number" instead of a "Yes/No" .... But I am concerned with future queries and filtering. So is this the only way around this problem? Setting the field to "Number"?? And where is it pulling the value of the option group from when I have everything set to null??


View 3 Replies View Related

Option Group To Search

May 24, 2006

Hello All

Talk about frustrating and I am sure the answer will be easy for some.

I have a Main form with search criteria and a subform with the data. See the attached image for the layout. The data comes from a query.

I have a yes/no field called "CompletedP" that I want to use to search on. This field is to filter in/out completed jobs. The Frame is called the generic name "Frame60". I am using an option group with the choice of yes or no plus other search criteria using combo boxes. The combo box filtering is fine but the option box does not appear to form any part of the search. To search I select any of the boxes and select "Search".

I post the code here.

Any assistance would be very much appreciated.

Private Sub cmdSearch_Click()
On Error Resume Next
Dim strFilterSQL As String
Dim sSql As String
Dim sCriteria As String
sCriteria = "WHERE 1=1 "

'This code is for a specific search where you will need to enter the exact string
'The source for this code can either be from a table or query
If Me![Location] <> "" Then
sCriteria = sCriteria & " AND qrySearchCriteriaSub6.Location = """ & Location & """"
End If

If Me![Code] <> "" Then
sCriteria = sCriteria & " AND qrySearchCriteriaSub6.Code like """ & Code & "*"""
End If

If Me![ClientCode] <> "" Then
sCriteria = sCriteria & " AND qrySearchCriteriaSub6.ClientCode Like """ & ClientCode & "*"""
End If

If Me![ProjectCode] <> "" Then
sCriteria = sCriteria & " AND qrySearchCriteriaSub6.ProjectCode = """ & ProjectCode & """"
End If

If Me![StartDate] <> "" And EndDate <> "" Then
sCriteria = sCriteria & " AND qrySearchCriteriaSub6.DateAllocated between #" & Format(StartDate, "dd-mmm-yyyy") & "# and #" & Format(EndDate, "dd-mmm-yyyy") & "#"
End If

Select Case Me.Frame60.Value
Case 1
strFilterSQL = sSql & " Where [CompletedP] = -1;"
Case 2
strFilterSQL = sSql & " Where [CompletedP] = 0;"
Case Else
strFilterSQL = sSql & ";"
End Select

If Nz(DCount("*", "qrySearchCriteriaSub6", Right(sCriteria, Len(sCriteria) - 14)), 0) > 0 Then
sSql = "SELECT DISTINCT [JobID],[Location],[Premises Details],[ProjectCode],[Code],[ClientCode],[DateAllocated],[CompletedP],[FileNumber] from qrySearchCriteriaSub6 " & sCriteria
Forms![frmSearchCriteriaMain6]![frmSearchCriteriaSub6].Form.RecordSource = sSql
MsgBox "The search failed find any records" & vbCr & vbCr & _
"that matches your search criteria?", vbOKOnly + vbQuestion, "Search Record"
End If

End Sub

View 2 Replies View Related

Option Group Problem. Thank You

Jul 17, 2006

Hi all,

I have created an option group with two buttons (New, Used). The defaultvalue of this option group is being set to nothing being selected(i.e no option is being checked). How do I make sure that the user has to choose either one of these option before he/she is allowed to save the record?

I dont want the default value to be either New or Used. And that is why I purposely set the default value of the option group = 0(optGroup.defaultValue = 0) on Form_Current event. However, I want the user to select either one of buttons(New, Used) before he/she is allowed to save the record.

Please assist. THanks

View 2 Replies View Related

Option Group On Subform

Sep 26, 2006

Hello all, I'm new to the site, hoping someone familiar with both continuous subforms and option groups could give me a hand please?

I have a "dialog window"-type form with a subform in it. The subforms are in continuous mode, and I have a scrolling window in my main form that contains one subform for each record that meets the criteria. On each subform, I have a 3-button option group, each option corresponding to a particular "type" that I want assigned to the value in a linked table. The choice is made by the user, then there is a control button that executes an update query which saves the choice to the table (value is 1, 2 or 3)
This works fine when there is one record returned. The problem I am running into is when there are multiple instances of the subform, each for a different record. When you click a choice in the subform for record #1, it updates the value in the option group for all of the open subforms. I need this to work such that a different choice can be made in the option group for each subreport. It seems like the application only knows one option group, rather than optiongroup.subform(record 1), optiongroup.subform(record)2, etc. Any ideas on what I am doing wrong?

The subform is "modal" and continuous, and the option group is unbound. I've attached copies of the forms and the save query. If anybody can offer some insight, I'd greatly appreciate it!

View 12 Replies View Related

Copyrights 2005-15 www.BigResource.com, All rights reserved