Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2006
    Posts
    7

    Unanswered: Setting ControlSource in VBA

    I'd like to set the ControlSource of an unbound combo box to a specific value in a form. How can I assign the ControlSource of a combo box in VBA to the result of an SQL query? What is the syntax for this?

    Thanks.

  2. #2
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    Use the RowSource property of the text box.

    Set the box type to Table/Query, insert the SQL to this propery in code and requery the box.

    tc

  3. #3
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    When you set the ControlSource of a control, you're not binding it to a particular table or query ... You're binding it to a particular column or expression WITHIN a table or query ... So, whatever table/query that the form is bound to, the control's ControlSource binds to that defined column in that same table or query ...
    Back to Access ... ADO is not the way to go for speed ...

Posting Permissions

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