Link to home
Start Free TrialLog in
Avatar of Andreamary
Andreamary

asked on

Controlling user entry in Excel user form combo boxes

I have an Excel user form with two combo boxes ('Task' and 'Status'):
> I tried to set the Style property of both combo boxes to 2 - fmStyleDropDownList to restrict the user to only selecting entries from the dropdown box and not being able to place their cursor in the field and remove or enter text.
> The 'Status' combo box appears to work without generating an error message
> The 'Task' combo box now gives me the following error message when I go to select an item from the dropdown menu:

Run-time error '380'
Could not set the Text property. Invalid property value.


When I click on Debug, it points me to a highlighted line:

    .Text = .List(.ListIndex, 1)

Open in new window


As I am not very savvy in this area, I have attached the Excel file with the user form in question to demonstrate what is happening.

Please let me know if you need any more information.

Thanks,
Andrea
Task_Plan_EE.xlsm
Avatar of Subodh Tiwari (Neeraj)
Subodh Tiwari (Neeraj)
Flag of India image

Try it like this...

.Text = .List(.ListIndex, 0)

Open in new window

Avatar of Andreamary
Andreamary

ASKER

Hi Subodh,

Thanks for the quick response! I tested the solution, and while it fixes the issue, it has changed the way the Task field is populated. Instead of being populated with the Task, it is being populated with the ID number. I set up the 3-column dropdown, etc. with the help of this forum, and during the course of the solution, a 'hidden' field was added to the user form which may be impacting this behaviour...? See screen captures below.

Is it possible for the task field to revert to being populated by the task, as per the original user form, but still benefit from the solution you have provided?

User generated image
User generated image
ASKER CERTIFIED SOLUTION
Avatar of Subodh Tiwari (Neeraj)
Subodh Tiwari (Neeraj)
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Perfect...thanks very much for the solution and explanation, Subodh!

Cheers,
Andrea
You're welcome Andrea! Glad I could help.
Thanks for the feedback.