Coding drop-down list to enable the Save button

I want to code my Drop-down list to enable my save button. By using the properties expression can this be done?
WDJ98338Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ClothahumpCommented:
Put code in the click event for the dropdown that enables the save:

Sub DropDown_Click
...
btnSave.Enabled=True
...
End Sub
0
VotechCommented:
Create a 'SelectedIndexChanged' event handler for your drop down list, if you do not know how to do that open up your web form or windows form, highlight the drop down list, open up the properties window by pressing F4 if it is not already open, click the "Events" button, then double click the "SelectedIndexChanged" event.

When in code behind view add:

If DDL_NAME.SelectedIndexChanged > 0 Then
  BTN_NAME.Enabled = True
End If

Replacing DDL_NAME and BTN_NAME with the real control names.  Just remove the If condition if you want the button to be enabled even if the first element is selected in the drop down list.  Usually not as the first element may say '-- Please Select --' or something.

If this is a Web Form you are doing, you will also need the AutoPostBack property set to "True" on the DropDownList.

Hope that helps.
Graham
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.