Welcome to Tech Support Forum home to more then 136,000 problems solved. Issues have included: Spyware, Malware, Virus Issues, Windows, Microsoft, Linux, Networking, Security, Hardware, and Gaming Getting your problem solved is as easy as:
1. Registering for a free account
2. Asking your question
3. Receiving an answer

Registered members:
* Get free support
* Communicate privately with other members (PM).
* Removal of this message
* See fewer ads.
* And much more..

 



Want to know how to post a question? click here Having problems with spyware and pop-ups? First Steps
Go Back   Tech Support Forum > Microsoft Support > Microsoft Office support
User Name
Password
Site Map Register Donate Rules Blogs Mark Forums Read


Microsoft Office support MS Office support forum

Reply
 
LinkBack Thread Tools
Old 02-04-2009, 09:23 AM   #1 (permalink)
Registered User
 
Join Date: Jan 2008
Posts: 17
OS: xp


Using Option Groups in Access to Select Report Records

I am using Access 2003. I used the wizard to set up an option group that has three items; Check1, Check2 and Check3. Check1 has an option value of 1, Check2 = 2, Check3 = 3. I am having a hard time reading the state of those check items within a query to select records; i.e. when Check1 is in focus I should retrieve records with a type = 1, when Check2 is in focus I should retrieve records with a type = 2; all records when Check3 is in focus. What good is the "option value"? And, how do I read which item has been checked when the query is run? I cannot find any on-line help with examples of code that would help me out.
beetle3247 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Important Information
Join the #1 Tech Support Forum Today - It's Totally Free!

TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free.

Join TechSupportforum.com Today - Click Here

Old 02-04-2009, 01:25 PM   #2 (permalink)
Tech, Microsoft Support
 
rbalaji's Avatar
 
Join Date: Dec 2008
Location: Chicagoland
Posts: 1,193
OS: Windows XP SP3


Re: Using Option Groups in Access to Select Report Records

You should be able say myform.myoptiongroup.value in the criteria row of your corresponding column in the query and that should pick up the value of the option group, compare it against the value of that field and either include it in the report or exclude it.
__________________
Balaji Ramanathan

Computers - You can't live with them, you can't live without them!

rbalaji is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 02-05-2009, 08:09 AM   #3 (permalink)
Registered User
 
Join Date: Jan 2008
Posts: 17
OS: xp


Re: Using Option Groups in Access to Select Report Records

The optionGroup's name appears to be Frame93 (as built through the wizard). I proved that was the optionGroup name by changing the default selection's value and the Default Value of Frame93 also changed. Now, I inserted Frame93 into my query just to see what value would show up (not including it in the selection criteria) and all I get is a small box on each record - no value at all. If I use Frame93 in the selection criteria I get nothing because the controls value is not numeric (the box is?). Any more help on this?
beetle3247 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 02-05-2009, 11:24 AM   #4 (permalink)
Tech, Microsoft Support
 
rbalaji's Avatar
 
Join Date: Dec 2008
Location: Chicagoland
Posts: 1,193
OS: Windows XP SP3


Re: Using Option Groups in Access to Select Report Records

My mistake. It should be myform.mycontrol.optionvalue, not just value. This is what Access VBA help says about the optionvalue property. Hope you find it helpful:
------------------------------------------
OptionValue Property
See AlsoApplies ToExampleSpecificsEach control in an option group has a numeric value that you can set with the OptionValue property. Read/write Long.

expression.OptionValue
expression Required. An expression that returns one of the objects in the Applies To list.

Remarks
When the control is selected, the number is assigned to the option group. If the option group is bound to a field, the value of the selected control's OptionValue property is stored in the field.

For example, this Region option group is bound to the Region field in a table. The Europe button has an OptionValue property setting of 1, the Asia button has a setting of 2, and the Africa button has a setting of 3. When one of these buttons is selected, the Region option group value will be the same as the OptionValue property setting for the selected control. In this case, because the Region option group is bound to the Region field, the value of this field in the table also equals 2.

Note The OptionValue property applies only to the check box, option button, and toggle button controls in an option group.

You can set the OptionValue property by using the control's property sheet, a macro, or Visual Basic.

Unless you change the OptionValue property yourself, the first control you place in an option group has a value of 1, the second control has a value of 2, and so on.

The OptionValue property is only available when the control is placed inside an option group control. When a check box, a toggle button, or an option button isn't in an option group, the control has no OptionValue property. Instead, each such control has a ControlSource property, and the value of each control will be either True if selected or False if not selected.

Example
The following example sets the OptionValue property for three option buttons in the "Ship Method Group" option group when a form opens. When an option button is selected in the option group, a message displays indicating the shipper's assigned ID number.

Private Sub Form_Open(Cancel As Integer)

Me.Controls("ABC Couriers").OptionValue = 15876
Me.Controls("Speedy Delivery").OptionValue = 742
Me.Controls("Lightning Express").OptionValue = 1256

End Sub

Private Sub Ship_Method_Group_Click()

MsgBox "The ID for the selected shipper is " &

Me.Controls("Ship Method Group").Value

End Sub
----------------------------------------------------------
__________________
Balaji Ramanathan

Computers - You can't live with them, you can't live without them!

rbalaji is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -7. The time now is 12:57 AM.



Copyright 2001 - 2009, Tech Support Forum
Home Tips Plus | Outdoor Basecamp | Automotive Support Forum

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85