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

    list box not updating until form loads

    I have a list box that displays the names of all the records. When I add, edit, or delete a record the list box does not update itself until I leave the form and come back into the form. How do I make it update when I Add a record?

    Some useful information
    Row Source:
    SELECT Inspections.ID, Inspections.[Number] FROM [Inspections Query];

    AfterUpdate [Event Procedure]:


    DoCmd.GoToRecord acDataForm, "StormDrainMHForm", acGoTo, lstMH.ListIndex + 1

    Thanks for any help.

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Try

    Me.ListboxName.Requery
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    cowboy is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Jan 2010
    Posts
    291
    Where should I put that? Maybe the before update of the text box to enter the ID?

  4. #4
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Not sure what you're doing that would then require the requery. The after update event of the form would catch changes to records and new records, but I don't think it fires when a record is deleted. For that you could use the delete event of the form.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. problem with the updating form
    By ngeng4 in forum Forms
    Replies: 32
    Last Post: 03-09-2010, 01:58 AM
  2. combo not updating form
    By cjamps in forum Forms
    Replies: 5
    Last Post: 04-14-2009, 12:00 PM
  3. Updating Table field from Form
    By Kunuk in forum Access
    Replies: 0
    Last Post: 02-26-2009, 11:41 PM
  4. Updating SQL server form Access form?
    By slash75 in forum Forms
    Replies: 1
    Last Post: 09-06-2008, 02:39 PM
  5. Replies: 0
    Last Post: 03-19-2006, 11:52 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