![]() |
|
|
#1
|
|||
|
|||
|
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 09:32 AM. |
|
#2
|
|||
|
|||
|
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.. |
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| List Box in Form is causing black boxes to print on a report | tigers | Forms | 1 | 07-30-2009 10:54 AM |
| code to print just first page of a report | tonyrice | Reports | 1 | 02-14-2007 12:07 PM |
| print form | vam | Forms | 0 | 05-02-2006 05:41 AM |
| How do I get a line not to print on a report... | tigers | Reports | 3 | 03-24-2006 05:40 AM |
| Report will not print a bound textbox | vvrt | Reports | 0 | 03-16-2006 11:16 AM |