Results 1 to 8 of 8
  1. #1
    New Lounger
    Join Date
    Nov 2009
    Location
    PA
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have several graphs currently in various forms which I've basically merged into one report. I'd like to automate the saving of an access form as a report. (I can do it manually by right-clicking the icon but I'd like to create s smoother operation for our users.) Any ideas how to? Thanks!

  2. Subscribe to our Windows Secrets Newsletter - It's Free!

    Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I don't understand what you are trying to do. Can you clarify ?
    What do you mean by
    "which I've basically merged into one report"
    Have you create a report with forms on it ?

    "I'd like to automate the saving of an access form as a report"
    Are you trying to print the form ? Are you trying to save the print preview as report ?

  4. #3
    New Lounger
    Join Date
    Nov 2009
    Location
    PA
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Will Thomas View Post
    I have several graphs currently in various forms which I've basically merged into one report. I'd like to automate the saving of an access form as a report. (I can do it manually by right-clicking the icon but I'd like to create s smoother operation for our users.) Any ideas how to? Thanks!
    I several charts in Access forms, saved those forms as reports and then merged the reports into one report in order to display all my graphs on one page. I saved those forms as reports by right clicking on the form object and selecting "Save As" and then "Report". I'd like to write code to save the form as a report. Thanks for helping me Francois.

  5. #4
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I think this is not possible. Somebody else maybe.
    I still don't understand the purpose of this. Why should you save the form as report every time it is open ? Once the report is created, you can use it when you want. Why create a new one ?

  6. #5
    5 Star Lounger AndrewKKWalker's Avatar
    Join Date
    Apr 2001
    Location
    Cambridge, UK
    Posts
    1,015
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Quote Originally Posted by Francois View Post
    I think this is not possible. Somebody else maybe.
    I still don't understand the purpose of this. Why should you save the form as report every time it is open ? Once the report is created, you can use it when you want. Why create a new one ?


    I'm with Francois on this regarding WHY?

    But assuming you have a form and you wanted to do it, then something like this might work

    Code:
    Dim strFormName as String
    Dim strRepName As String
    
    strFormName="Put Your Form Name Here"
    DoCmd.OpenForm strFormName, acDesign, , , , acHidden
    
    DoCmd.SetWarnings False
    'Send the New Report name to the Key Buffer with and Enter Key at the end
    'If you just want to save it with the same name then just send a single ~
    
    strRepName = "Put Reports Name Here"
    SendKeys strRepName & "~"
    DoCmd.RunCommand acCmdSaveAsReport
    
    DoCmd.Close acForm, strFormName acSaveNo
    
    DoCmd.SetWarnings True
    Set frm = Nothing
    Andrew

  7. #6
    New Lounger
    Join Date
    Nov 2009
    Location
    PA
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by AndrewKKWalker View Post
    I'm with Francois on this regarding WHY?

    But assuming you have a form and you wanted to do it, then something like this might work

    Code:
    Dim strFormName as String
    Dim strRepName As String
    
    strFormName="Put Your Form Name Here"
    DoCmd.OpenForm strFormName, acDesign, , , , acHidden
    
    DoCmd.SetWarnings False
    'Send the New Report name to the Key Buffer with and Enter Key at the end
    'If you just want to save it with the same name then just send a single ~
    
    strRepName = "Put Reports Name Here"
    SendKeys strRepName & "~"
    DoCmd.RunCommand acCmdSaveAsReport
    
    DoCmd.Close acForm, strFormName acSaveNo
    
    DoCmd.SetWarnings True
    Set frm = Nothing
    Thanks for your help...I'll try this code today and let you know what happens...FYI..I'm doing it this way in order to set multiple charts in one report for a presentation.

  8. #7
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,483
    Thanks
    3
    Thanked 41 Times in 41 Posts
    Have you considered making each chart a subreport in a main report? That would let you do the single report for presentation without resorting to VBA. Also, charts can be done as reports, they don't have to be put on a form....
    Wendell

  9. #8
    New Lounger
    Join Date
    Nov 2009
    Location
    PA
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Will Thomas View Post
    Thanks for your help...I'll try this code today and let you know what happens...FYI..I'm doing it this way in order to set multiple charts in one report for a presentation.
    It worked!! Thanks a lot!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •