Microsoft Access Forums

Go Back   Microsoft Access Forums > Access Forums > Forms

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 09-17-2009, 11:54 AM
Brian62 Brian62 is offline Windows XP Access 2007 (version 12.0)
Advanced Beginner
 
Join Date: Aug 2009
Posts: 85
Brian62 is on a distinguished road
Default 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 09:32 AM.
Reply With Quote
  #2  
Old 09-18-2009, 11:50 AM
Brian62 Brian62 is offline Windows XP Access 2007 (version 12.0)
Advanced Beginner
 
Join Date: Aug 2009
Posts: 85
Brian62 is on a distinguished road
Default

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..
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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


All times are GMT -8. The time now is 08:22 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.