Results 1 to 6 of 6
  1. #1
    rts is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2012
    Posts
    34

    Refreshing Report Data

    Hello,



    I have a report based off of a query. I am trying to get it to requery or refresh on GotFocus, but I can't seem to get anything to work. I've searched and tried different ways like Me.Requery, DoCmd.RefreshRecord, etc. but nothing seems to work. It seems like the GotFocus part is maybe part of the problem. For example, I have a button on the report that opens a modal dialog form to update data. When the "OK" button is pushed on that form and it closes, I assumed that would trigger the GotFocus event for the report in the background that opened the form. Am I mistaken? I even added Application.DoCmd.SelectObject acReport, "Report Name" to the code after the modal dialog form closes to try to trigger the GotFocus event, but the report doesn't requery. Any help would be greatly appreciated!!

    Thanks

  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,642
    Why not just put the requery command with the full report reference either behind that close button or in the close event of that form?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    rts is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2012
    Posts
    34
    That was easy enough! Thank you much - I think I tried everything, but that. One more question - this query the report is based on is a parameter query wherein the user has to enter the Project Number to pull up the report. It's not the hugest deal for them to reenter when it requeries, but is there a way to pass that back into the requery so the report doesn't prompt for the user to enter it again? Thanks again for your help.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,642
    I would have the user enter the number on a form, and point the query there. You could have a button on that form that opens the report.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    rts is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2012
    Posts
    34
    That's a better way to do it! Thank you!!!

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,642
    No problemo! I virtually always use forms to gather user input.
    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. Refreshing a listbox
    By PatrickCairns in forum Programming
    Replies: 9
    Last Post: 12-07-2012, 05:26 PM
  2. Replies: 7
    Last Post: 11-13-2012, 01:44 PM
  3. refreshing tables?
    By danbo in forum Access
    Replies: 1
    Last Post: 12-23-2011, 03:05 AM
  4. SubForm not refreshing
    By hawkins in forum Access
    Replies: 2
    Last Post: 08-16-2011, 04:30 PM
  5. Refreshing a subform?
    By Shag84 in forum Forms
    Replies: 4
    Last Post: 08-07-2011, 10:07 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