Results 1 to 5 of 5
  1. #1
    LaughingBull is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Jul 2015
    Location
    Toledo Ohio
    Posts
    143

    Field Update


    I have and attendance Form

    Click image for larger version. 

Name:	AttendanceForm.jpg 
Views:	10 
Size:	45.9 KB 
ID:	21919

    When I have a new location I click Enter New Location and that form open and I enter the new location close that form.
    When I select the location the new record I just entered does not show up in the selection list. I have to close the attendance form and reopen it for the new location to show up on the list of locations.

    Is there a way for the drop down location list to be automatically updated as soon as I enter a new location into the Location Table and I do not have to close the form and reopen it?

  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,641
    You could probably use the NotInList event of the combo rather than a special button (search here on "notinlist"). Keeping it like it is, add code to the close event of the location form:

    Forms!ThisFormName.LocationComboName.Requery
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,625
    Alternative:

    Open the location form with acDialog parameter, this will suspend code execution from the calling form until location form closes.
    Then the next line of code would be:
    Me.comboboxname.Requery

    However, the NotInList event is a better approach to adding the new location record 'on-the-fly' during data entry.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #4
    LaughingBull is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Jul 2015
    Location
    Toledo Ohio
    Posts
    143
    I used the on Close event and it works great
    Thank you

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    Happy to help! If that form can be opened independently, you may want to test that "ThisFormName" is open first, or you'll get an error if it isn't. Search here on IsLoaded for that test.
    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. Replies: 14
    Last Post: 01-27-2014, 12:33 PM
  2. Replies: 1
    Last Post: 05-17-2013, 12:53 PM
  3. Replies: 6
    Last Post: 04-26-2013, 10:07 AM
  4. Replies: 2
    Last Post: 08-30-2012, 07:59 AM
  5. Update field in table after update on a subform
    By jpkeller55 in forum Queries
    Replies: 3
    Last Post: 09-30-2010, 08:02 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