Refresh Listbox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rsteph
    New Member
    • Oct 2006
    • 71

    Refresh Listbox

    I've got a list box that has about 6-7 columns with information, pulled from a table. When you click on a row in the list box it displays all the information in a series of text boxes, so that the information can be edited. I've got an add and delete button, so you can select a row in the listbox, then delete it; or enter information in the listboxes, then click the add button and add the information to the table.

    The buttons work fine with regard to making the changed so the table. Now I'm looking for a way to essentially refresh the listbox when the button is pressed to represent the new table information. I'm trying to use the .Requery method, but it doesn't seem to work.

    Now, if I delete a line, then click on another line, it will show "#deleted" (or something to that effect) for each item in the row; but it won't clear it away. Any help for how to get the listbox to refresh would be greatly appreciated. Thank you in advanace.
  • rsteph
    New Member
    • Oct 2006
    • 71

    #2
    Anyone have any thoughts on where I could start to look to figure this out?

    Comment

    • Stang02GT
      Recognized Expert Top Contributor
      • Jun 2007
      • 1206

      #3
      http://www.kayodeok.bt internet.co.uk/favorites/kbofficeaccessh owto.htm
      http://www.accessmonst er.com/
      http://www.databasedev .co.uk/forms.html
      http://www.mvps.org/access/



      here are some very good access sites that will be able to help you out

      Comment

      • JKing
        Recognized Expert Top Contributor
        • Jun 2007
        • 1206

        #4
        Hi, I tested this out and Requery successfully removes the deleted rows for me.

        Are you using .Requery for the form or the listbox itself? Perhaps you could post your code because there maybe something else that is wrong.

        Comment

        • rsteph
          New Member
          • Oct 2006
          • 71

          #5
          Nevermind I'm dumb, after looking through this some more I realized I was putting the .Requery line in the wrong place in the code. I had accidentally placed it in the error handling section. I've got that working now.

          Comment

          • JKing
            Recognized Expert Top Contributor
            • Jun 2007
            • 1206

            #6
            Originally posted by rsteph
            Nevermind I'm dumb, after looking through this some more I realized I was putting the .Requery line in the wrong place in the code. I had accidentally placed it in the error handling section. I've got that working now.
            Hehe, you're not dumb. It's a common mistake and happens even to the best of us. Just earlier today I spent over an hour trying to figure an error out to find I needed to move a statement one line up. Sometimes the most simple errors can be the most painful to solve.

            Glad you resolved it though.

            Jking

            Comment

            Working...