Results 1 to 4 of 4
  1. #1
    Robert2150 is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Sep 2013
    Location
    Sparks, Nv
    Posts
    102

    Returning to Record after Viewing Report

    I have a form with a dropdown Lookup Field that opens a specific record in that form. I also have a View Report feature that opens a report to view on that specific record.
    My problem is that when closing the "View Report Feature", I am returned to my main form, however I have to use the dropdown lookup to return to the record that I have loaded when I "Viewed" the report.
    My question is: Is there some code that would return the program to the specific record that I was viewing prior to "Viewing" the report?


    This is the second time that I have asked for help on this matter, I hope that I explained it better this time.

    Thank you for your help in advanced.

  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,518
    Are you requerying the form or something? Or closing it? You could adapt this:

    http://www.baldyweb.com/Requery.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Robert2150 is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Sep 2013
    Location
    Sparks, Nv
    Posts
    102
    I do not query or re-query, here is the code I use to view the report.

    Private Sub VIEW_EQUIPMENT_REPORT_Click()
    strWhere = "[Property Number] = " & Me.[Property Number]
    DoCmd.OpenReport "RESERVE REQUIREMENT REPORT", acViewPreview, , strWhere
    DoCmd.ShowToolbar "Ribbon", acToolbarNo
    DoCmd.Close acForm, "ENLARGED PROP INFO", acSaveNo
    End Sub

    Thank you for your interest.

  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,518
    Since you're closing the form, you'll have to save the property number somewhere, so it can be used in my code above. Options include the OpenArgs argument of OpenReport and a global variable.
    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. Returning to record after viewing a report.
    By Robert2150 in forum Access
    Replies: 6
    Last Post: 09-01-2015, 08:31 AM
  2. Help with Report viewing and printing
    By bscottj48 in forum Reports
    Replies: 2
    Last Post: 04-14-2015, 12:32 PM
  3. Viewing a Report
    By Robert2150 in forum Access
    Replies: 3
    Last Post: 03-02-2015, 07:42 PM
  4. Replies: 9
    Last Post: 01-20-2013, 10:27 PM
  5. Replies: 1
    Last Post: 08-10-2011, 06:28 AM

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