Results 1 to 3 of 3
  1. #1
    TerriLynnG is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    1

    Change/select record source of subreports

    Hello,



    I have a database with a table for current information and another that is appended at the end of each month to store history.

    I then built queries to give the info I need for subreports...separate ones for each table.

    I built an unbound report with the multiple subreports for the current info...

    My question...is it possible to change the record source of the subreports from the current info queries to the history queries, depending on a user selection, or do I need to create another report with subreports for the history queries?

    I am trying to get away with not creating another 12-15 subreports.

    Any help would be greatly appreciated.

    Terri

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    I use the Open event of report to set RecordSource.

    Private Sub Report_Open(Cancel As Integer)
    Me.RecordSource = Nz(Me.OpenArgs, Me.RecordSource)
    End Sub

    However, I have never tried to set subreport RecordSource.
    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.

  3. #3
    tstoneami is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    71
    Private Sub Report_Open(Cancel As Integer)
    Static intCallCount As Long
    If intCallCount = 0 Then Me.RecordSource = "qryTest-B"
    intCallCount = intCallCount + 1
    End Sub

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

Similar Threads

  1. on change select record?
    By hlcarlin in forum Programming
    Replies: 2
    Last Post: 07-04-2011, 09:45 AM
  2. Select Data Source Won't Cancel!
    By allenrickson in forum Reports
    Replies: 2
    Last Post: 06-21-2011, 11:55 AM
  3. Replies: 5
    Last Post: 05-18-2011, 11:02 AM
  4. Replies: 2
    Last Post: 11-29-2010, 11:16 AM
  5. change print preview record source
    By alaric01 in forum Reports
    Replies: 10
    Last Post: 10-07-2010, 09:51 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