Results 1 to 2 of 2
  1. #1
    Brian62 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2009
    Posts
    147

    Print Report from Form ID

    I created a query for the report to pull the information from the current form record but can't get it to work. In the query under criteria I entered this:
    =[form]![SAE PHO VA FORM]![ID]



    The form gets it's information from a table where I also enter new information to create a new record.

    The query works but when the form is open and I want to print that current form record from a command button to a report it asked for a ID. It should pull the current form ID (record) without asking me for the ID.

    This works in all versions but Access 2007. Thanks!
    Last edited by Brian62; 09-18-2009 at 11:32 AM.

  2. #2
    Brian62 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2009
    Posts
    147
    I figured it by downloading a 2007 template. I really don't like 2007 much since older version code and many other things don't work in 2007.

    Here is how you get it to work.

    On the print button you must create a embedded macro "on Click".
    In the Macro start with:
    OpenReport select your report name then in the Where condition enter: ="[ID]=" & [ID]
    Or whatever your Primary Key names are.
    Next line (Action) RunCommand enter Print
    Next line enter (action) close

    In the report you can choose either the table the form is pulling from or a query with the same information.

    I hope this helps those who are having the same problem I was having..

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

Similar Threads

  1. Replies: 1
    Last Post: 07-30-2009, 12:54 PM
  2. code to print just first page of a report
    By tonyrice in forum Reports
    Replies: 1
    Last Post: 02-14-2007, 03:07 PM
  3. print form
    By vam in forum Forms
    Replies: 0
    Last Post: 05-02-2006, 07:41 AM
  4. Replies: 3
    Last Post: 03-24-2006, 08:40 AM
  5. Report will not print a bound textbox
    By vvrt in forum Reports
    Replies: 0
    Last Post: 03-16-2006, 02:16 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