Results 1 to 4 of 4
  1. #1
    cowboy is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Jan 2010
    Posts
    291

    I want my Listbox to update when I put a new name in.

    I have a listbox that lists the name of all my records, I want that when I change a name or add a name it does it instantly. At the moment I have to switch to another record for it to update.

    The listbox Row Source for lstDI:
    SELECT InspectionsDI.ID, InspectionsDI.[MN12] FROM InspectionsDI ORDER BY InspectionsDI.[MN12];

    When I type a new name in textbox txtMN I have in the after update code:
    Me.lstDI.Requery

    That doesnt do the trick, and it does call the requery because I put a breakpoint on it to make sure. Any ideas?

  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
    At a guess, I'd say the record currently on the form isn't saved yet. Try adding

    DoCmd.RunCommand acCmdSaveRecord

    before the requery to force it to save.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    also try me.refresh after your me.requery if the above doesnt work out.

  4. #4
    cowboy is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Jan 2010
    Posts
    291
    Worked with just the save.

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

Similar Threads

  1. Replies: 6
    Last Post: 03-27-2010, 11:18 AM
  2. Listbox question
    By uaguy3005 in forum Access
    Replies: 1
    Last Post: 03-05-2010, 08:35 AM
  3. Columns in a Listbox
    By craigalaniz in forum Access
    Replies: 3
    Last Post: 01-07-2010, 01:11 PM
  4. Multi-select listbox and update flag in table
    By Suresh in forum Programming
    Replies: 0
    Last Post: 12-19-2007, 01:04 AM
  5. adding list to a listbox
    By jetrow in forum Access
    Replies: 0
    Last Post: 08-15-2006, 03:36 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