Results 1 to 10 of 10
  1. #1
    ijared is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2018
    Posts
    19

    listbox doesn't populate

    Private Sub Addtolist_Click()
    Me.vol_my_worked_hrs.AddItem (Me.MyText1)
    Me.MyText1 = Null
    End Sub


    I get no errors but the listbox doesn't populate. Any idea why?

  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
    What is the row source type? From help:

    The RowSourceType property of the specified control must be set to "Value List".
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    ijared is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2018
    Posts
    19
    Yes, the row source type is set to "Value List". My listbox is vol_my_worked_hrs and my comand button to add my textbox is

    Private Sub Addtolist_Click()
    Me.vol_my_worked_hrs.AddItem (Me.MyText1)
    Me.MyText1 = Null
    End Sub

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Just tested and your code worked fine. How many columns does the combo have? I think you have to populate them all if more than one. If one, can you attach the db here?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    ijared is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2018
    Posts
    19
    Thanks. I think the problem must come from my database itself. I will look at it.

  6. #6
    ijared is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2018
    Posts
    19
    I don't seem to be able to solve. My column count is 2.

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    If there are two columns, I think you have to populate both. Can you attach a sample db here?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    By the way, I never use value lists, always a table with the values. I share Allen's view:

    http://allenbrowne.com/ser-27.html
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    ijared is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2018
    Posts
    19
    I'got it working. I convert a combobox to a listbox and that must be a reason why nothing was going in. Now I have to figure out how to save this data evrtime data is put in..

  10. #10
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,654

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

Similar Threads

  1. form doesn't populate by query results!
    By accesslessio in forum Access
    Replies: 9
    Last Post: 09-22-2016, 06:47 AM
  2. Replies: 13
    Last Post: 09-10-2015, 03:37 PM
  3. Replies: 21
    Last Post: 08-29-2013, 11:08 AM
  4. Replies: 10
    Last Post: 06-18-2013, 02:00 PM
  5. Replies: 2
    Last Post: 12-30-2011, 07:19 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