Results 1 to 9 of 9
  1. #1
    cotri is offline Advanced Beginner
    Windows XP Access 2000
    Join Date
    Jan 2010
    Posts
    32

    Printing report from Form

    I am able to print a report of all records from a command button on a form with



    DoCmd.OpenReport "General Input Info", acViewPreview

    I can also print just the current form to the report with

    DoCmd.OpenReport "General Input Info", acViewPreview “[ID] = “ & [ID].

    What I would like to do is print a report showing the current form and all the forms after that form. In other words, none of the records previous to the current form listed but do show the current record and all others after that as determined by the auto number ID field. I am able to filter by form in the ID field with “>45” showing me all records with an ID of 46 and above but I want to be able simply print the report from the command button that is on the form. Thanks

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows XP Access 2002
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    And this does not work?
    DoCmd.OpenReport "General Input Info", acViewPreview, , “[ID] > 45 “

  3. #3
    cotri is offline Advanced Beginner
    Windows XP Access 2000
    Join Date
    Jan 2010
    Posts
    32
    Quote Originally Posted by RuralGuy View Post
    And this does not work?
    DoCmd.OpenReport "General Input Info", acViewPreview, , “[ID] > 45 “
    Thanks for the help here. Yes that does work but the “> 45” was just a example. I wanted it to be all records beyond whatever record you happened on at that time so I used
    DoCmd.OpenReport "General Ebay Input Info", acViewPreview, , "[ID] >= " & [ID]
    and it seems to work fine. One other question, when I click the command button I get a window “Enter Parameter Value” for one of the fields in the record. I leave it blank and click “OK” and then I get the report I want. Any ideal what is causing this? Thanks again for the help

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows XP Access 2002
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    That almost always means you have misspelled something in the query.

  5. #5
    cotri is offline Advanced Beginner
    Windows XP Access 2000
    Join Date
    Jan 2010
    Posts
    32
    Quote Originally Posted by RuralGuy View Post
    And this does not work?
    DoCmd.OpenReport "General Input Info", acViewPreview, , “[ID] > 45 “

    That did it....Thanks

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows XP Access 2002
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Great! Is this thread ready for you to follow the link in my sig and mark as Solved?

  7. #7
    FranCorona is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    May 2013
    Location
    California
    Posts
    74
    Hi, I am not that savvy with Access and was wondering, where do you put this code? DoCmd.OpenReport "General Input Info", acViewPreview “[ID] = “ & [ID] to print just the current form? Thank you and have a great day!

  8. #8
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    In the code for a CommandButton.

  9. #9
    FranCorona is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    May 2013
    Location
    California
    Posts
    74
    Thank you for your help!

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

Similar Threads

  1. Replies: 2
    Last Post: 07-28-2014, 01:15 PM
  2. Report printing unknown blank lines.
    By dgrzalja in forum Reports
    Replies: 10
    Last Post: 11-02-2009, 12:21 PM
  3. Replies: 3
    Last Post: 10-19-2009, 01:14 PM
  4. Replies: 16
    Last Post: 06-03-2009, 07:01 AM
  5. Report Printing Error
    By gjohnson71 in forum Reports
    Replies: 4
    Last Post: 03-07-2009, 12:36 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