Results 1 to 5 of 5
  1. #1
    aceSoft is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2017
    Posts
    8

    Display item from a populated combobox in a messages box

    Hi there im trying to display each combobox item in a messages box ,

    Code:
    Dim i As Long
     With cboUser
       For i = 0 To .ListCount
        msgsbox cboUser.ItemData(i)
      Next i
    End With
    This aint working.

  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
    Always helpful if you tell us the error message, or what exactly is going wrong. "ain't working" ...ain't helpful.

    Offhand, it's MsgBox, not msgsbox.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    aceSoft is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2017
    Posts
    8
    so sory, it gives me Invalid use of null on the code

    Code:
     MsgBox cboUser.ItemData(i)
    I have a Combobox that is populated from a table.
    Then I wanted to show every item in this combobox to a MsgsBox
    Can you kindly show me how to do it properly.
    Im doing a loop to display each Item continously.

  4. #4
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    One slight modification, to eliminate the Invalid use of Null error:

    Code:
    Dim i As Long
     With cboUser
       For i = 0 To .ListCount - 1
        MsgBox cboUser.ItemData(i)
      Next i
    End With

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  5. #5
    aceSoft is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2017
    Posts
    8
    Thank you very much sir...

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

Similar Threads

  1. Replies: 1
    Last Post: 02-01-2015, 12:16 AM
  2. Replies: 1
    Last Post: 04-21-2014, 11:29 AM
  3. Display multiple scrolling messages
    By GaryElwood in forum Access
    Replies: 10
    Last Post: 06-24-2013, 01:06 PM
  4. Replies: 5
    Last Post: 07-29-2011, 03:07 PM
  5. Replies: 0
    Last Post: 04-13-2009, 04:02 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