Get Displayed Text of a ComboBox

Discussion in 'Access VBA Modules' started by David C. Holley, Jun 3, 2010.

  1. I've been playing with programically getting the text value of a ComboBox,
    but I keep getting an error message that the control has to have the focus
    in order to reference the .Text property. If I explicity set the focus, I'm
    able to get the value without any problems.

    Is this normal?
     
    David C. Holley, Jun 3, 2010
    #1
    1. Advertisements

  2. David C. Holley

    Rick Brandt Guest

    "David C. Holley" <David.C.Holley> wrote:

    > I've been playing with programically getting the text value of a ComboBox,
    > but I keep getting an error message that the control has to have the focus
    > in order to reference the .Text property. If I explicity set the focus,
    > I'm able to get the value without any problems.
    >
    > Is this normal?


    For Access yes. If you know the ordinal position of the column being
    displayed you can use...

    Me.ComboBoxName.Column(n)

    ....where n is the zero-based position of the column you want.
     
    Rick Brandt, Jun 3, 2010
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Similar Threads
  1. G Lam

    Delete records displayed in a Form

    G Lam, Jul 28, 2003, in forum: Access VBA Modules
    Replies:
    4
    Views:
    139
  2. Stephen J. Levine MD

    Programmatically creating text field with combobox

    Stephen J. Levine MD, Mar 4, 2004, in forum: Access VBA Modules
    Replies:
    7
    Views:
    88
    Marshall Barton
    Mar 6, 2004
  3. Sudha
    Replies:
    2
    Views:
    114
    Sudha
    Jun 1, 2004
  4. EduardH

    Error messages not displayed - how do I fix?

    EduardH, Jun 6, 2004, in forum: Access VBA Modules
    Replies:
    2
    Views:
    90
    EduardH
    Jun 6, 2004
  5. Acie
    Replies:
    4
    Views:
    97
    Guest
    Jul 10, 2004
  6. Marco Brilo

    Changing Combobox to text box

    Marco Brilo, Sep 18, 2007, in forum: Access VBA Modules
    Replies:
    4
    Views:
    124
    Marco Brilo
    Sep 20, 2007
  7. RichW

    Limit Text displayed in Combo box

    RichW, Nov 13, 2009, in forum: Access VBA Modules
    Replies:
    4
    Views:
    112
    RichW
    Nov 13, 2009
  8. ryguy7272

    Dates are not displayed in ComboBox

    ryguy7272, Feb 9, 2010, in forum: Access VBA Modules
    Replies:
    2
    Views:
    89
    ryguy7272
    Feb 9, 2010
Loading...