Results 1 to 2 of 2
  1. #1
    GeorgeJ is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Dec 2014
    Posts
    67

    Filling out a combo-box

    Elsewhere in this forum I am asking for help in updating the info in a subform after its underlying data table gets changed. While I am waiting to see if I will be able to accomplish what I am trying to accomplish using a subform. I am exploring the possibility of using a drop-down combo box instead. I have not been successful in finding references on how to change combobox info using VB.

    Would anybody out there be able to help me with this situation?:

    Suppose I have a Simple form MyForm which has 3 controls, Button1, Button2 and ComboBox1.



    When Myform loads there is nothing in Combobox1. The user press Button1 and the Combobox gets 3 string items - "CB1", "CB2" and "CB3" which display immediately.

    The user then presses Button2 and ComboBox1 reverts to its original state of having nothing in it.


    Would anyone out there be kind enough to show me what the code should look like in the Click routines of Button1 and Button2, or to show me a link to somewhere where VB programing of combobox contents is discussed in detail?

    Thanks in advance

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    You would set the RowSource property, either to a query or table if the values were stored there, or a value list if you used that. To empty, set it to an empty string ("").
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 04-24-2014, 10:02 AM
  2. Replies: 3
    Last Post: 01-23-2014, 01:19 AM
  3. filling table
    By janco in forum Queries
    Replies: 2
    Last Post: 07-24-2011, 09:16 AM
  4. Filling in Fields
    By BigCat in forum Access
    Replies: 2
    Last Post: 05-19-2011, 02:02 PM
  5. Auto Filling
    By tgavin in forum Forms
    Replies: 2
    Last Post: 08-02-2010, 10:47 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums