DropDown Menu where user can't edit

Posted on 2004-11-28
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
    LVL 5

    Assisted Solution

    All you have to do is change the style property of a combo box to dropdown list.
    LVL 2

    Author Comment

    That is true but when you do. the text property is read only.
    LVL 48

    Accepted Solution

    >>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
    LVL 1

    Expert Comment

    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.
    LVL 2

    Author Comment

    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

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Suggested Solutions

    The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
    Article by: Martin
    Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    729 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

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now