Results 1 to 8 of 8
  1. #1
    lenm is offline Novice
    Windows XP Access 2002
    Join Date
    Oct 2012
    Posts
    4

    Need Subform to Refresh

    I have a form called Address and a subform called Property. The Property subform includes only some of the data available from its source table. I have one button on the Property Subform that allows the user to open and view all of the details about the property. I have a second button that opens a NewProperty form that is used solely for data entry. When the user completes the form, the press a button called Close. When pressing Close, the New Property form closes and returns the user back to the Address form (that also includes the Property Subform).

    My problem is that the data that the user just input does not refresh on the imbedded Property Subform. I can use Refresh All on the menu bar to get it to refresh and I can create a button with a macro for Refresh that does the job....but I want it to refresh when the user closes out of the New Property form.

    I have tried many things, but nothing works.

    Advice is appreicated!



    Len

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    The button that opens the NewProperty form should use the Dialog argument to stop the code in the SubForm from executing until the NewProperty form closes. You can then do a Me.Requery and it will execute when the 2nd form closes.

  3. #3
    lenm is offline Novice
    Windows XP Access 2002
    Join Date
    Oct 2012
    Posts
    4
    That sounds promising...but I do not know how to do that. Can you provide some more detail?

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    What do you have behind the NewProperty button? Code, macro? Show it here if you can.

  5. #5
    lenm is offline Novice
    Windows XP Access 2002
    Join Date
    Oct 2012
    Posts
    4
    I have an event procedure for On Click - this open the "new" subform for data entry on the Property New Form

    Private Sub Add_New_Property_Click()
    DoCmd.OpenForm "Property_New", acNormal, , Me.AddressID = Forms!Address.id
    End Sub

    I have a couple of other event procedures for On Load (carries through the Master id to populate the foreign key in the Property table) and Before Update (populated update date/time)

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Excellent! Just modify your code to:
    Code:
    Private Sub Add_New_Property_Click()
       DoCmd.OpenForm "Property_New", acNormal, , Me.AddressID = Forms!Address.id, , acDialog
       Me.Requery
    End Sub

  7. #7
    lenm is offline Novice
    Windows XP Access 2002
    Join Date
    Oct 2012
    Posts
    4
    RuralGuy - YOU ROCK! Thanks for your help!

  8. #8
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Excellent! Glad we could help.

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

Similar Threads

  1. Refresh Requery Subform
    By eww in forum Programming
    Replies: 1
    Last Post: 04-05-2011, 09:19 AM
  2. Replies: 15
    Last Post: 11-09-2010, 04:27 PM
  3. refresh subform
    By asmith in forum Forms
    Replies: 5
    Last Post: 09-27-2010, 10:58 AM
  4. Problems with subform refresh
    By Viggen66 in forum Queries
    Replies: 2
    Last Post: 02-23-2010, 04:07 AM
  5. My subform doesnt refresh????? HELP!
    By LiamMurphy in forum Forms
    Replies: 1
    Last Post: 03-09-2006, 09:08 PM

Tags for this Thread

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