Solved

Force Option Button to Selected

Posted on 2001-08-09
3
249 Views
Last Modified: 2012-06-21
I created an Option Frame and put Option Buttons on it - optFirst (OptionValue Property set to 1) and optSecond (OptionValue Property set to 2).
When the Form opens, the Option buttons are gray - none of them (especially the First one) is selected.
I tried
Me!optFirst.Value = True     (you can't set a value to this object)
Me!optFirst = True          (you can't set a value to this object)
Me!frOptFrame!optFirst.Value = True   (property Let procedure not defined...)


Help says I can set the Value of the Option Control

"Value Property - You can use the Value property to determine or specify if a control is selected, the selected value or option within the control, the text contained in a text box control, or the value of a custom property.
Check box, option button, and toggle button controls. Determines or specifies whether or not the control is selected."

BUT the example only shows how to read the value

"If Forms!Customers!Credit.Value = False Then"

but doesn't show how to SET it to true.

How do you force the first Option Button to be selected when the Form opens?
0
Comment
Question by:DavidWare
3 Comments
 
LVL 2

Expert Comment

by:hotbudare
ID: 6371038
Option buttons within an option frame CANNOT have True/False values. The are, by default asigned an integer value, starting from 1. The value of the select option button becomes the value of the option frame.
If you want to give this option frame a value, use it's own DefaultValue and or Value properties.

HTH/EQTA
T.S.U. Mario Osorio
Punto Fijo, Falcon, Venezuela
0
 
LVL 3

Accepted Solution

by:
Co earned 50 total points
ID: 6371414
Meaning that if you want to activate the first option:

Me!optFirst.OptionValue = 1

Me!frOptFrame.Value = 1

If you put this in your "on open" event on the form, the first option should be selected.

Hope this helps,

Co
0
 

Author Comment

by:DavidWare
ID: 6371983
Thanks for the syntax.  OptionValue!
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Combobox row source 2 20
Update a text value in another table 10 37
Dirty form - conditional formatting 5 15
Field naming convntions - MS Access 7 20
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

805 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question