1 Attachment(s)
Disable Command Button when Radio Button Enabled
I was looking for a code to have multiple actions with a radio button
When the radio button pressed, need the CB2 (command button) disabled and contents from Text-1 copied to Text-2
Can some please help me to make a code to make this happen?
See the picture
Attachment 122513
:)
Re: Disable Command Button when Radio Button Enabled
First thing. Once the radio button is clicked, it cannot be unclicked by the user. Wouldn't that be an issue? Maybe a checkbox would be better?
In either case. Within that control's click event
Code:
If Option1.Value = True Then ' or if a checkbox: If Check1.Value = vbChecked Then
CB2.Enabled = False
Text2.Text = Text1.Text
End If
Re: Disable Command Button when Radio Button Enabled
Quote:
Originally Posted by
LaVolpe
Wouldn't that be an issue? Maybe a checkbox would be better?
OR, as an alternative, place TWO option buttons on the form, then you COULD uncheck one or the other.
Re: Disable Command Button when Radio Button Enabled
Quote:
Originally Posted by
SamOscarBrown
OR, as an alternative, place TWO option buttons on the form, then you COULD uncheck one or the other.
Or, simply toggle the option button back to False just before the click event exits. But in either case, disabling the 2nd command button doesn't make sense unless the action is meant to be 1-time only
Re: Disable Command Button when Radio Button Enabled
LaVolpe,
I am not a VB expert. I am trying to add this to an existing macro.
It's running on VBA 7 environment.
I tried the above code and it doesn't work
Can I move this to VB.net?
Re: Disable Command Button when Radio Button Enabled
Quote:
Originally Posted by
wire-brush
LaVolpe,
I am not a VB expert. I am trying to add this to an existing macro.
It's running on VBA 7 environment.
I tried the above code and it doesn't work
Can I move this to VB.net?
If you would've mentioned VBA, we could've advise you to post it in the Office portion of the forum. I'll inform a moderator so they can move this for you.
Re: Disable Command Button when Radio Button Enabled
Thread moved from the 'VB6' forum to the 'Office Development/VBA' forum (while VBA and VB6 have some similarities, they are not the same thing)
(thanks for letting us know LaVolpe :thumb: )