|
-
Nov 10th, 1999, 06:55 PM
#1
Thread Starter
New Member
I need to have a textbox and a combobox to be invisible to start but if someone clicks on the Optionbutton "Yes" to have them the textbox and combobox to be visible. I have tried several variations of the code below but none seem to work. Any help me?
Private Sub Upgrade_Click()
If Upgrade(1).Value = 1 Then
UpgradeDate.Visible = True
UpgradeDateLabel.Visible = True
UpgradeTo.Visible = True
UpgradeToLabel.Visible = True
End If
End Sub
Thanks.
------------------
Stanley
-
Nov 10th, 1999, 07:01 PM
#2
Frenzied Member
Upgrade(1) looks like it's an array but
Private Sub Upgrade_Click() doesn't
maybe you're putting the code in the wrong place!
------------------
Mark Sreeves
Analyst Programmer
[email protected]
A BMW Group Company
-
Nov 10th, 1999, 08:33 PM
#3
Thread Starter
New Member
Ok ignoring my code above do you know of anyway to do what I am trying to do?
------------------
Stanley
-
Nov 10th, 1999, 09:01 PM
#4
Ok, lets start from the beginning. You have an empty form. When you add an Option button to the form, the name of this Option button would be Option1 (by default) and when you add command button it would be Command1 (by default). Same with Textbox - it would be Text1. So, lets assume that you have added those controls to your form (Option1, Option2 (this one is to hide controls again) Command1, Text1)
Code:
Private Sub Form_Load()
Option1.Caption = "&Show controls"
Option2.Caption = "&Hide controls"
Option1.Value = True
End Sub
Private Sub Option1_Click()
Command1.Visible = True
Text1.Visible = True
End Sub
Private Sub Option2_Click()
Command1.Visible = False
Text1.Visible = False
End Sub
Note: Of course, you better create a Control Array (for Option button).
Regards,
------------------
Serge
Software Developer
[email protected]
[email protected]
ICQ#: 51055819
-
Nov 10th, 1999, 09:01 PM
#5
Hyperactive Member
textbox.visible = optionbutton.value
combobox.visible = textbox.visible
put this in the click event of the optionbutton
-
Nov 10th, 1999, 09:18 PM
#6
Crazy D's code will work only if you have more then 1 option button. Because, if you have only one, then you woun't be able to change the option value back to FALSE.
Regards,
------------------
Serge
Software Developer
[email protected]
[email protected]
ICQ#: 51055819
-
Nov 11th, 1999, 02:39 AM
#7
New Member
Did you try:
OptionButton_Click()
if OptionButton.Value = True then
combobox.visible = true
textbox.visible = true
endif
end sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|