Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing a report on current record 1

Status
Not open for further replies.

matpj

Technical User
Mar 28, 2001
687
0
0
GB
Hi,

I have a report set-up, which when run, will display a list of all outstanding problem tickets in my table.

I want to be able to put a command button on my form that will print this report, but only for the current record.

how do I do this?
what do I type, and where?
 
In the query that supplies the reports data place a criteria under the id field that will reference the Problem Ticket to print. The format of that criteria is:

[Forms]![YourFormName]![YourControlName]

Then when you run the query it will look for the value of [YourControlName] and only show that record.

Joe Miller
joe.miller@flotech.net
 
I've got a similar problem - i've got an order form which has an orderid field to distinguish each order, i've also got a report to show the whole order - how do i get the report to lock on to the record i'm using in the input form and only print out that record. the form is based on a query which identifies the record by asking for the order number, but i already have this information on the form and i cant get the report to see this? any ideas?
 
You follow the same technique as described above to accomplish this.

Joe Miller
joe.miller@flotech.net
 
I do not have a query that my report gets data from.
My report is purely from the form/table

how would i achieve this result?
as there is nowhere to put this criteria

There is a unique field : Caller Reference
Do I just have to create a query?

thanks for your help,
Matt
 
I also need to print this form twice for each button press.

how do I tell it to print twice?

Is it possible to have two reports, each running from the same query, that can be printed out at the same time.

the application is a Customer Change of Service report, that I need to print a Customer copy and a Copy for ourselves. The report will be the same apart from some text in the title.
any ideas?
 
If you use this code on your command button, it will limit the report to the currentrecord:

Dim stDocName As String
stDocName = "rptorders"
DoCmd.OpenReport stDocName, acNormal, , "(([orderid] = '" & Me.orderid & "'))"

In this example, orderid is your primary key field. Me.orderid refers to the control on the form that contains orderid.

As far as printing it twice, a simple solution would be to put the Docmd.Openreport line in the code twice. Mike Rohde
rohdem@marshallengines.com
 
I Tried this using a query based report, but I get multiple labels printed. (I get a label for every time the particular contact is listed in the dataset) How can I print JUST ONE of label only if the contact shows up in the dataset several times?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top