View Full Version : Solved: print current record
lucas
03-08-2005, 02:30 PM
when I set up a button to print the current record, it prints the form also. If I set up a report, It shows me all of the records. How can I print just the current record without the form?:dunno
Tanis
03-09-2005, 08:43 AM
Create a report with the fields you require. Create a query with the fields that will appear in the report. In the criteria for chosen field enter a parameter e.g.[Enter a date]
lucas
03-09-2005, 10:29 AM
Hey Tanis,
Thanks for the help.
I have the report and the query. In the criteria for the query it now asks for the name.(when I run the query)
[Enter RecipeName]
hope I am following you on this. The problem is it just brings up the table with only the record I typed in the box. I have been reading and I thought this should be easy but.....could use another lead if you see something I am doing wrong.
Steve
GaryB
03-09-2005, 02:26 PM
Hi Lucas,
I remembered seeing an answer to this on another web site and I just found it. This site seems to be a pretty nice one too and they are very open to us using they're code. This is the link to the page where the code is.
Gary B
www.mvps.org/access/reports/rpt0002.htm (http://www.mvps.org/access/reports/rpt0002.htm)
AlanG
03-09-2005, 05:43 PM
Hi
Use the Where argument of the Docmd.OpenReport method to filter your report...something like this
Docmd.OpenReport "MyReportName", acNormal , , "RecipeID = " & Me.RecipeID
This assumes that you have the RecipeID available as a reference on the form you're clicking the command button and that it's a numeric data type. You don't need any criteria in the query your report is based on, just the fields you want shown on the printed report.
HTH
Alan
lucas
03-09-2005, 08:02 PM
Thanks GaryB & AlanG,
Gary, your link was to a piece of button code that works great, even gives a preview first if you want, or set it to print.
AlanG, your piece of button code works great too. It just prints it out.
I learned a lot on this little excursion. appreciate the insights.
Anne Troy
03-09-2005, 08:15 PM
Marking it solved, Steve? :)
(Hint: Click the Thread Tools link at the top of the page.)
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.