Results 1 to 2 of 2
  1. #1
    ramirezx@ddmfg.com is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    40

    MS Access VBA Me.RecordSource report will not save

    Hi,
    I have a report in Access 2016 and a button in the report that will change the record source. i have that working, but what I want it to do next is save the new record source in that report?


    -------------------------------------------------- Private Sub btnComplete_Click()

    Me.RecordSource = "qry_01i_Status_Complete_Filter"

    Me.btnPending.Visible = True
    Me.btnPending.SetFocus
    Me.btnAll.Visible = False
    Me.btnComplete.Visible = False

    DoCmd.Save acReport, "rpt_TEMPLATE_STATUS"

    End Sub


    -------------------------------------------------- when i close and re open the report is does not keep the change? Hope someone can help?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    you have to begin with an edit...

    Code:
        DoCmd.OpenReport vRpt, acViewDesign
           Set rpt = Reports(vRpt)
           rpt.Printer = vPtr
          rpt.RecordSource = "qry_01i_Status_Complete_Filter"
    
        DoCmd.Close acReport, rpt.Name, acSaveYes

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

Similar Threads

  1. Replies: 2
    Last Post: 07-15-2015, 08:35 PM
  2. Replies: 2
    Last Post: 10-01-2014, 12:38 PM
  3. Replies: 0
    Last Post: 05-09-2011, 01:51 PM
  4. Replies: 1
    Last Post: 04-25-2011, 12:20 PM
  5. Changing A Report Recordsource from a form
    By warrenjburns in forum Reports
    Replies: 0
    Last Post: 04-09-2009, 05:38 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