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?
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?
Steve
"Nearly all men can stand adversity, but if you want to test a man's character, give him power."
-Abraham Lincoln
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]
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
Steve
"Nearly all men can stand adversity, but if you want to test a man's character, give him power."
-Abraham Lincoln
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
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
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.
Steve
"Nearly all men can stand adversity, but if you want to test a man's character, give him power."
-Abraham Lincoln
Marking it solved, Steve?
(Hint: Click the Thread Tools link at the top of the page.)
~Anne Troy