CodingInCircles
CodingInCircles

Reputation: 2807

How to create a report in MS Access 2007?

I have to build an MS Access form that acts as a registration form for delegates of a conference. I have to print out a receipt acknowledging the delegate's details and payment and other details. I think I have to make a report for this. So I made a rough report containing the required fields and placed a button on the form that prints the report out. When I clicked on it for the first record, it displayed the details faithfully. However, when I navigated to the second record and did the same, it displayed the details of the first record again. What do I do? Also, how can I customise it to mimic a receipt's format? Like so:

"Received with thanks from Mr./Ms. , a sum of Rs." and so on and so forth?

Upvotes: 0

Views: 1191

Answers (1)

BIBD
BIBD

Reputation: 15384

You've probably attached the record source for the Report to the same table/query that you are using for the Form. When you open the Report, you'll actually have receipts for each record in the source table/query.

What I would do in this case, is add a filter to the Report, and filter the records to show the same record as is currently displayed on the form. You can do this when you open the Report. e.g.,

docmd.OpenReport "foo", acViewNormal, , "fooID = " & me.fooID

(note: you may have explicitly turn on filters in the report's parameters)

You can display a customised line like that by building up a string in the default valude for an unbound text box.

="Text"  & "foo" & me.value & "" 

Or you can set the text box's value on the fly, probably during the OnFormat event.

Or you can do that as part of the query you use to provided data to the report, and use a bound text box.

Upvotes: 2

Related Questions