Results 1 to 2 of 2
  1. #1
    PSSMargaret is offline Advanced Beginner
    Windows 10 Access 2010 64bit
    Join Date
    Dec 2016
    Posts
    55

    Print Records in Continuous Subform to an Existing Report

    Hello All,

    I have a main form with an unbound subform. There are two date boxes on the main form that when entered will run a query and update the subform with any records within that date range. Then there is a command button than when clicked will run another query on the results already in the subform and display any duplicate records. I have added another command button and would like to be able to print whatever records are displayed (original records, or records from the first query, or records from the last query) in the subform to an existing report. I have tried the code below. It opens the report but with all of the records. I used the code below to export whatever records are in the subform to Excel and it works fine. Any help would be greatly appreciated with the code below or a better method to print whatever records are currently displayed in the subform.



    Code:
    Me.frmDuplicatesSfrm.SetFocus
    [frmDuplicatesSfrm].Form![PerformID].ColumnHidden = False
    DoCmd.GoToControl "PerformID"
    DoCmd.RunCommand acCmdSelectAllRecords
    DoCmd.RunCommand acCmdCopy
    DoCmd.OpenReport "rptPerformData", acViewPreview, , , acWindowNormal
    I have also posted this question at the below link since I am not receiving any replies here.
    http://www.dbforums.com/showthread.p...71#post6650271
    Last edited by PSSMargaret; 11-20-2017 at 12:41 PM.

  2. #2
    PSSMargaret is offline Advanced Beginner
    Windows 10 Access 2010 64bit
    Join Date
    Dec 2016
    Posts
    55
    Forgot to mention that the report does have a existing record source for a different purpose.

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

Similar Threads

  1. Replies: 6
    Last Post: 11-12-2017, 11:51 PM
  2. Replies: 14
    Last Post: 10-01-2015, 08:56 AM
  3. Replies: 9
    Last Post: 09-05-2013, 02:11 PM
  4. Replies: 5
    Last Post: 08-24-2013, 08:04 PM
  5. Replies: 1
    Last Post: 12-03-2012, 03:15 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