none
Combo box should open with 'Choose One' RRS feed

  • Question

  • a very simple question - when I open a form and a combo box appears (before dropping down or anything), I would like it to say something like 'Choose One' or 'Make a Selection'.   Is there a way to store this in a property or something without putting it in the table you are using to select records from?  I've been putting 'Choose One' as the first record of a lot of my tables and setting the combo box value to 1 in the load event and it works fine, but it just doesn't seem right.   I've looked thru the properties and don't see one that would do it; is there a special method to set it up.   I'm using Access 2010.
    Sunday, February 5, 2017 11:39 PM

Answers

  • Hi Gilbernator,

    Would you mind upgrading Access 2010 to Access 2013? I made a test with Default value property for Combobox in both Access 2010 and 2013 by Property Sheet of Combobox->Data Tab->Default Value as "Choose one". It works under Access 2013, but failed in Access 2010.

    For a workaround without adding value in table, I suggest you try below query and code in Form load, ID and UName are the fields.

    Select 0 as ID ,"Choose One" AS  UName FROM tblSplit
    UNION
    SELECT [tblSplit].[ID], [tblSplit].[UName] FROM tblSplit;

    Code:

    Private Sub Form_Load()
    If IsNull(Me.UClass.Value) Then
    Me.UClass.Value = 0
    End If
    End Sub

    Best Regards,

    Edward


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, February 6, 2017 4:32 AM