Results 1 to 10 of 10
  1. #1
    Orabidoo is offline Novice
    Windows 7 Access 2007
    Join Date
    Apr 2009
    Posts
    19

    Question Refresh a list box

    Hi everybody,



    I'm new to Access and I'm trying to make a command button refresh a list box (it's based on a query and lists people of the same gender, I use option buttons to set the desired gender). I used the wizard and chose Form operations/Refresh form data, and I just get an error message.

    Thanks!

  2. #2
    Orabidoo is offline Novice
    Windows 7 Access 2007
    Join Date
    Apr 2009
    Posts
    19
    I made a macro that does a requery, it works!

  3. #3
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    A little self help is always a good thing. Thanks for posting back.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    BTW, did you know all you need to do is requery the ListBox? Me.ListBoxName.Requery

  5. #5
    Orabidoo is offline Novice
    Windows 7 Access 2007
    Join Date
    Apr 2009
    Posts
    19
    I tried that but that didn't work. I'll try again!

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Let us know the results. If it does not work then there is something wrong with your system and we can probably help there too.

  7. #7
    Orabidoo is offline Novice
    Windows 7 Access 2007
    Join Date
    Apr 2009
    Posts
    19
    "BTW, did you know all you need to do is requery the ListBox? Me.ListBoxName.Requery"

    I typed that right into the OnClick property field at first, but that didn't work. However, I discovered the VB code window and added the call there instead. It works now, thanks!

    I'll probably come back with more questions soon.

  8. #8
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    See how much wiser you are today than yesterday? Feels good doesn't it? You are welcome and have fun.

  9. #9
    Orabidoo is offline Novice
    Windows 7 Access 2007
    Join Date
    Apr 2009
    Posts
    19
    So...I copied the file to my laptop and brought it to the office to show my boss. I opened the database and everything looked fine. Tried the form. Nope, didn't work. The list box didn't update. Does this have anything to do with the trust settings? Should it? This isn't a macro.

  10. #10
    Orabidoo is offline Novice
    Windows 7 Access 2007
    Join Date
    Apr 2009
    Posts
    19
    Ah, that's it... But how does this work when you use the database seperately with the Access runtime?

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

Similar Threads

  1. About value in list box?
    By viccop in forum Forms
    Replies: 0
    Last Post: 04-08-2009, 08:05 PM
  2. List box to populate other list boxes
    By Nathan in forum Forms
    Replies: 0
    Last Post: 03-03-2009, 07:22 PM
  3. refresh datasheet as text changes
    By mkhan in forum Forms
    Replies: 0
    Last Post: 09-06-2008, 07:46 AM
  4. Refresh form search text box
    By oxicottin in forum Forms
    Replies: 2
    Last Post: 11-19-2007, 02:28 PM
  5. My subform doesnt refresh????? HELP!
    By LiamMurphy in forum Forms
    Replies: 1
    Last Post: 03-09-2006, 09:08 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