Results 1 to 7 of 7

Thread: Lock combo boxes from user input?

Threaded View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2006
    Posts
    17

    Lock combo boxes from user input?

    I need to restrict user input on a combo box while still allowing them to select an item from the drop down menu. I know this can easily be achieved by setting the style to VbComboDrop-DownList, however this will not work for me.

    Here is the scenario.

    When a user loads a new form, information from an access database populates my combo boxes. As the user changes different items on the form, the combo boxes re populate, and in some cases, show a default value.

    Example:

    User selects natural gas as their fuel type. The units drop down menu only lists MCF, CCF, DTH. If the user selects electric as their fuel type, the units drop down menu switches to KWH, MWH. This is all fine while setting the combo box to be a VbComboDrop-DropList.

    The user is able to save this information. Upon reloading the form, the saved information is pulled in as the default values for the combo boxes (ie, what they previously selected is what shows up in the combo box as a selected item). To do this, I had the combo boxes populate as I normally would, and then I did cmbUnits.text = glbHeatingFuelUnits.

    Now, if I set the combo boxes to VbComboDrop-DropList, I am unable to use the .text property to select and display what they chose and saved before. I tried setting the property from VbComboDropDown when loading the form so the information could be displayed, and then locking it after it loads with the VbComboDrop-DropList style setting but I receive a read only error.


    So basically, how can I lock these combo boxes from user input while still allowing the program to display values I previously saved in them?


    --> FUTURE PROBLEM ::: Also, there is a chance that a user will save an item that will eventually be removed form my database, and therefore will not be listed in the combo boxes options, however I still want that item to show even though its not in the drop down list.
    Last edited by Arin; Aug 3rd, 2006 at 01:09 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width