General discussion

Locked

Access Reports and Forms

By PaulAlexander ·
How can I print one record using a pre-defined report from a button I've created on a form. The record I want is shown on the report. Access Help gives an answewr, but it doesn't matter how many times I try it don't work !! (You know [fieldname]= FORMS![formname]![fieldname] )

Is there something missing ?

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Access Reports and Forms

by DuppyPog In reply to Access Reports and Forms

Your form should have a field that uniquely identifies that record. In the underlying query for the report, the parameter criteria should point to that field - like this:
[Forms]![frmMyFormName]![txtFieldname]
This tells the query to get the parameter from the form field to return that specific record.
Your button on the form just needs to either print preview the report, or print it.

Hope this helps-
Lynnette

Collapse -

Access Reports and Forms

by PaulAlexander In reply to Access Reports and Forms

The question was auto-closed by TechRepublic

Collapse -

Access Reports and Forms

by john_wills In reply to Access Reports and Forms

The previous answer should work, but I don't like it because it insists that the nested program(the report in this case) know what is nesting it, very unmodular. The structure I use for this kind of work is this:
Private Sub PrintClientInformation_Click()
DoCmd.OpenReport "rptClientInformation", acPreview, , "[ClientID]=" & Me.ClientID
End Sub
However, there may well be, as you suggest, something missing from your call, dependent perhaps on something in your form, although I cannot think what.

Collapse -

Access Reports and Forms

by PaulAlexander In reply to Access Reports and Forms

The question was auto-closed by TechRepublic

Collapse -

Access Reports and Forms

by PaulAlexander In reply to Access Reports and Forms

This question was auto closed due to inactivity

Back to Web Development Forum
5 total posts (Page 1 of 1)  

Related Discussions

Related Forums