Print single record in report

maintt

New member
Local time
Today, 01:20
Joined
Jun 15, 2010
Messages
8
Hi all

I have a report which shows all clients, i want to print off the same report one record only, is this possible?

many thanks

maintt
 
Hi all

I have a report which shows all clients, i want to print off the same report one record only, is this possible?

many thanks

maintt


How did you get on with single record being printed?

If you are still needing help suggestion is as follows:

Open your form in design view, then Press F11 on the keyboard to open the Navigation Pane. Then Select MACROS. In macros create a new macro, then select the action to open a report, in the arguments below select the report to open, change the Print option to Preview and below there you will see conditons. In the conditions select the elipses button to the right it will open the build wizard, then select table section and find your table then in the next column select a field which will hold unique information like an id field, then place in the = (equal sign), then select the form section and find your open form in design view, and in the middle column select the ID field.

Save and and close the macro.

Then drag the macro into your form (it will create a button for you), then save your form, change the view and when you have selected a record you want to preview click the button.
 
Hey,

I have a problem. I'm using Access 2010 and I'm trying to print a report of one specific record. It should be the record I'm viewing in the form. I've tried all the things posted here, but it does not work. Access either asks me to fill in the ID myself or it just says the where condition is invalid. My form is named: "Invoeropkomsten", my ID field is called: "Opkomstid" and my report is named: "qryOpkomst" (These are dutch names). Let's say I make a macro to print the current record. I fill in exactly these things:

Report name: qryOpkomst
View: Print Preview
Filter name:
Where Condition: "[Opkomstid] = " & Me![Opkomstid]
Window Mode: Normal

What am I doing wrong?
 
The link I posted above uses VBA code, not a macro. You can't use Me in a macro, so you'd have to use the full form reference. Personally I'd switch to code, unless you're creating a web database.
 
Thanks for the reply, But it still doesn't work. This is the code I've made in VBA:

Private Sub Command37_Click()

DoCmd.OpenReport "qryOpkomst", acViewPreview, , "Opkomstid = " & Me.Opkomstid

End Sub


I can't figure out what's wrong with it. Can anyone help me?

Rob
 
What does "doesn't work" mean, exactly? What is the data type of that field? Is that really the name of a report?
 
Doesn't work means that Access still asks me for a value for Opkomstid and if I fill in a valid number, it shows all the records instead of the one I want. The type of Opkomstid is Autonumber and yes, qryOpkomst is realy the name of a report. It is automatically made from a query that is also named qryOpkomst. But that is not the problem, because when I just renamed the report to rptOpkomst, it still didn't work.

Rob
 
If it's asking for a value, one of those names is incorrect, or that isn't. Field in the report's source.
 
Thanks Trevor, your instructions worked perfectly...I didn't see this question addressed in either of my Access 2010 books, so this is a big help.
 
Good day folks I have been trying to do the same ...print a single record on a report I thought I had followed all the advice here but still can't get it to work the button works and actually prints but I am still getting all the records instead of the current record in the form I have the following behind the button on my form:

Private Sub Command64_Click()
End Sub
Private Sub Cmdprint_Click()
'print current record
'using rpt_workorders
If IsNull(Me!id_workorder) Then
MsgBox "Please Select a Valid Work Order", _
vbOKOnly, "Error"
Exit Sub
End If
DoCmd.OpenReport "rpt_workorders", acViewPreview, , _
"id_workorder= " & Me.id_workorder
End Sub

Any help would be greatly appreciated. Thanks in advance
 
Can you post the db here? That looks correct for a numeric data type.
 
Another variation on the theme:

Code:
Function OriginalsImage_Report()

    With CodeContextObject
        DoCmd.OpenReport "Originals Images Large", acViewPreview, "", "[Orig Old Stock]=" & .[Orig Old Stock], acWindowNormal
    End With
End Function

Simon
 
Please forgive the structure being a noobie I am sure there are some issues with it but here is the db the print function is located on the work order form. Thanks in advance for taking a look.
 

Attachments

The code is intended to work on the main report. You have data in a subreport, though I can't see why.
 
That code still wouldn't work. Why have you made it a subreport? Why not just a report?
 
I followed the advise here and a how to and that's what I ended up with the idea is to create the work order in the form then be bale to print out that single work order
 
Try creating a report with the appropriate data. It looks like you dropped the form into a report, creating a subreport.
 
Thanks for the help on this Paul it is much appreciated I will try your suggestion and let you know how I make out Thanks again
 

Users who are viewing this thread

Back
Top Bottom