HELP!!! Enabling & Disabling Buttons

AshleyJohn

Registered User.
Local time
Today, 17:07
Joined
Jan 16, 2007
Messages
16
I have a form which has several drop down menus all of which have the same options 'yes' & 'no'. When a user selects no from the drop down menu I would like the button that corresponds to this menu to be disabled until the user selects yes.

I.e. Website (yes, no) the website button will only be enabled if the user selects yes.

Can anyone help?

Thank you guys this will help me loads!!! :)
 
you could have something similar to this:

Code:
if 'combobox' = "No" then
     button.enabled = False
end if

and to enable it, you would put something like:

Code:
if 'combobox' = "Yes" then
     button.enabled = True
end if

Remember 'combobox' is the name you called your combo box and same goes for button.

let me know this is not what you meant, and ill try and help :)
 
WOW what a quick reply!

Thanks Dave very much apprciated! This is exactally what I meant!
Your a star :)
 
Just thought, (apologise I am new to this) where abouts would I put this code? Can I click on the drop down list in form design view and select onUpdate from the properties of the list then add it there?
 
i would put it on the 'On Change' property. So everytime you selected one of the options from the combo box, it will run the code :)
 
Thanks again Dave! :)

I may need your help again in the future is that ok?
 
happy to help :)

and sure, ill always be around, if not, im sure you can always send me a private message! but then again, theres a forum of people here to help :P
 
The code should be in the After Update event and maybe even in the OnCurrent event of the form.
 
Thanks Rich,

I have put this code in but keep getting the following error

Compile error:
Expected: expression

mmm any help :)
 
can you past all the code in please in one of the events?
 
______________________________________________
Private Sub Combo72_AfterUpdate()
if 'Combo72' = "No" then
button.Enabled = False
End If

if 'Combo72' = "Yes" then
button.Enabled = True
End If
End Sub

_____________________________________________

Basically I have four comboboxes and four buttons:

Website(Yes/No) E-Commerce(Yes/No) Submit(Yes/No) Other(yes/No)
Website Button E-Commerce Button Submit Button Other Button

I would like the user to select yes from the combobox to enable the relevant button.

Your help is much apprciated! Thanks :)
 
Cos some clients will have websites and submits and others will only have e-commerce etc...

Therefore my form looks like this:

Website: YES/NO
E-Commerce: YES/NO
Submit: YES/NO
Others: YES/NO

Website Button - E-Commerce Button - Submit Button - Others Button

Do you see what I mean?
 
Then use a different approach and I would say that an option box is the best option.
 
In an option group just one value can be selected at a time, thus you don't need code to enable/disable buttons etc. The control wizard will do a lot of the work for you
 
OK So how would I do this? I dont seem to have a control wizard for option group.
 
I seem to have worked it out:

If Me.Submit_Xpress = "Yes" Then
Me.Command94.Enabled = True
Else: Me.Command94.Enabled = False
End If

Thanks for your help everyone
 

Users who are viewing this thread

Back
Top Bottom