DropDown Menu where user can't edit

Posted on 2004-11-28
Medium Priority
Last Modified: 2013-11-13
I am tring to add a drop down combo that will let the user pick from the drop downs but not allow them to edit the text property but I the programmer needs to control the .text property.  I use the text property to clear it when the reset is pressed. Also I am using the text property to input into the database.  I could use all the help I can get on this one.
Question by:daveaton

Assisted Solution

mms_master earned 100 total points
ID: 12689743
All you have to do is change the style property of a combo box to dropdown list.

Author Comment

ID: 12689810
That is true but when you do. the text property is read only.
LVL 54

Accepted Solution

Ryan Chong earned 100 total points
ID: 12689846
>>That is true but when you do. the text property is read only.
Interface wise, yes it's readonly, yet you still can change it programmingly, like:

Combo1.List(Combo1.ListIndex) = newValue

Expert Comment

ID: 12697911
You can also set the KeyAscii field to 0 so if the user tries to change the value nothing happens, but you are still able to select from the list.

We do this all the time.

Author Comment

ID: 12754380
Ok thanks guys I split points because I figured out the answer I needed between two comments..

Here is how I fixed the problem

on my combo drop down, I changed the style property to dropdown but I still needed to clear results to a clear box, so I made a function that just  cleared and reinput the data into the dropdown box which cleared the .text value.

I was clearing the value like this..  cboDropDown.text ="" but when the style is in dropdown mode only it gave me a error about read only..

Well thanks guys, I got it working.

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question