473,320 Members | 2,193 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,320 software developers and data experts.

OptionButton Property Disable

Hi guys.

I have an option group or "frame", and inside I have 4 buttons (Option Buttons).

They are called:

opt_mtto
opt_elec
opt_qlty
opt_complete

So I was selecting the property of each button to Enable = False, so when my form load they will be Disabled. But, I didn't to be coding each button to enable each of the buttons, I though.. why wouldn't be better to say to the frame to be disable, so all inside would be disable.

So instead of going for each button, I return to my properties and enabled them again, but I disable my frame, so this made the same way, but only with 1 click .

But I got a problem, when I click a button I want my frame get enabled so I code:

Expand|Select|Wrap|Line Numbers
  1. frame01.enabled = True
(This enabled all my buttons..)

But I only want 1 button Disable, in this case:

Expand|Select|Wrap|Line Numbers
  1. opt_mtto.enabled = false
so my code is:

Expand|Select|Wrap|Line Numbers
  1.  
  2. frame01.enabled = true
  3.  
  4. opt_mtto.enabled = false
  5.  
  6.  
and this get me an error: 2101: "The setting you entered isn't valid for this property".

So I made this the other way, I enabled my frame, and then call the option button to be disable, and it works...

I only want to know why, I can't do this, the first way I mention.

I repeat is:

- When Form_Load the property are already set to the frame as False (no CODE, is set manually, in properties)

- When click button, enable Frame,

- Just after of enable the frame, disable one of the buttons inside.

- ERROR...

Why
Mar 5 '15 #1
4 4861
Brilstern
208 100+
Are you selecting opt_mtto and trying to disable it? I don't think you can disable a selected value. You will also see that error immediately when you open the form if opt_motto is disabled because I would assume your first radio button is your default button.

-SB
Mar 5 '15 #2
Brilstern
208 100+
Well maybe I spoke too soon,

I created a form that on load runs:
Expand|Select|Wrap|Line Numbers
  1. frame01.Enabled = False
When I press my command button this runs:
Expand|Select|Wrap|Line Numbers
  1. frame01.Enabled = True
  2. opt_mtto.Enabled = False
I can use the other three radio buttons like normal and my default button is still opt_motto.

No errors. Have I replicated what you are trying to accomplish?
Mar 5 '15 #3
@Stevan Bias
Yeah, you replicated the same way as I do, and it also worked for me, I was like... what the..?! so I keep searching why was appearing this error.

It appears that if you focus on the frame, you can't disable the button. I had to re-focus in other place.
Mar 5 '15 #4
Brilstern
208 100+
Interesting. I never set my focus to the frame so I probably would not have ran into that error. Glad you got it figured out! We learn something new everyday. :)
Mar 5 '15 #5

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

Similar topics

5
by: Bob Bedford | last post by:
I create checkboxes using datas from a database (with PHP). I store all values in an array, as I must pass this value like a Form value. Now, in some cases, when a checkbox is selected, I must...
1
by: Lars Netzel | last post by:
Hello, Making your own WebCustomControl, how you do disable properties in the design view? For example my WebCustomControl does not use text, so the default property Font is missleading when...
13
by: Rich | last post by:
Hello, So I would like to disable a textbox on a vb.net form without the text getting grayed out. In vb6 I could place a textbox control on a frame control and disable the frame leaving the...
2
by: frojask (frojask | last post by:
I have a problem assigning a control with index to an object type variable with SE no problem at all when the control isn't a member of an arra obviously, because of my application purpose, can't...
6
by: | last post by:
hi, how to disable the controls in page? thanks For each myControl in Page.Controls 'want to disable myControl? Next
2
by: Gabriele Bertolucci | last post by:
In VBA I would like to test if an OptionButton is chiled of an OptionGroup. I wrote this test OptionButton.Parent.ControlType = acOptionGroup It's all OK if this test is executed on an...
1
by: elLiven | last post by:
Hi I'm trying to learn VBA in Excel mysel. Getting stuck on userforms. I can create a userform with optionbuttons and command buttons. I want to know how to have the form display the...
3
by: Pietro | last post by:
Hi all, First of all I'd like to thank you very very much ,as finally after many years of searching,I could find a code to disable/enable the shift key,but actually i cannot use the code as I'm...
3
by: junglej815 | last post by:
Hey Everyone... Like I said I have no experience really with VB and need some help if anyone can offer some. Sorry if there have been questions like this already, I looked around but didn't see...
6
by: msingh24 | last post by:
I have 2 forms and I want to grey out a checkbox or option button in the 2nd form when one checkbox/optionbutton is selected in this 1st form Please HELP!! Thanks
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.