View Full Version : Opening Report from Form - tricky and urgent


Browser
02-21-2001, 08:30 PM
I am viewing a record in a form, and want to be able to click a button and view a report on that particular record.
The report would usually list all records, but based on the ID of the record on the form, we wish to filter the report to show only that records data.

ANY help greatly appreciated as we're in a bit of a bother.
cheers
dan

BoroLee
02-21-2001, 10:59 PM
Create a report based on the data in the form. Then create a macro which Opens the Report, but has criteria which is equal to the form.

I've done it before, and it works fine.

If I don't make sense, e-mail me.

Lee.

Neal
02-22-2001, 08:06 AM
You can put a command button on the form and have this as the code behind the On Click Event:

Docmd.OpenReport "YourReportName",,,"[RecordId] = forms!YourFormName!RecordID"

Chris RR
02-22-2001, 09:57 AM
Or, create a query that uses the form fields as its criteria, then base the report on that query.