Results 1 to 5 of 5
  1. #1
    Juan4412 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Dec 2010
    Posts
    209

    Get Value Of Combo Box

    I have a combo box on a user form whose row source is a select from a table. This table holds two fields, a PKID field and a field called count, the count field is what is being displayed in the combo box and it is a numeric field.



    How do I read the selected value from the combo box? In the (I think this is the appropriate spot) SelectedIndexChanged event first verify that a value was actually selected, and 2 write the number selected to a variable.

    What means is this achieved through in Access 2013 VBA?

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    What is the format of the combobox? ColumnWidths?

    Usually you would use the AfterUpdate Event

  3. #3
    Juan4412 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Dec 2010
    Posts
    209
    Quote Originally Posted by orange View Post
    What is the format of the combobox? ColumnWidths?

    Usually you would use the AfterUpdate Event
    Noformatting applied.

    The column widths set to 0";1"

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    If you do a test by putting a debug.print YOURCboNamehere in the afterUpdate event of the combo-- what do you get?
    You can put a break point on the event and step through the code.
    Maybe I'm not understanding your issue??

  5. #5
    Juan4412 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Dec 2010
    Posts
    209
    That prints the value! Thank you!

    Would I want to use the AfterUpdate() event or the SelectedIndexChange() event?

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

Similar Threads

  1. Replies: 5
    Last Post: 09-22-2016, 08:42 AM
  2. Replies: 11
    Last Post: 09-03-2015, 11:12 AM
  3. Replies: 2
    Last Post: 10-21-2014, 07:57 AM
  4. Replies: 3
    Last Post: 07-03-2013, 10:38 AM
  5. Replies: 4
    Last Post: 08-16-2011, 05:54 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
  •  
Other Forums: Microsoft Office Forums