If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Create a report from form
I have created a form. I now want to create a command button that opens a
report but only with the record (with detail records in subform) to populate the report. Everytime I create the report, it brings in all records not the one that is on the screen. That is the only record that I want to appear on the report. I would then click on the commad button and the report would open up with that record only. Many thanks in advance. |
#2
|
|||
|
|||
Create a report from form
While it is possible to tell Access to take a form and print it, it may not
be a good idea. After all, forms are intended to be used as on-screen displays, while reports are intended to fit/work on a printed page. And, as you've found, telling Access to "print my form" gets ALL the records associated with that form. Two alternate approaches: 1. Create a report, with the layout you need for print. Add a command button from the form to open THAT report, and send along the ID of the record being viewed on the form. See Access HELP for the exact syntax of: DoCmd.OpenReport ,,,, 2. Modify the way your form loads its records so it only loads one. Send that to print. I recommend the former. -- Regards Jeff Boyce www.InformationFutures.net Microsoft Office/Access MVP http://mvp.support.microsoft.com/ Microsoft IT Academy Program Mentor http://microsoftitacademy.com/ "glenngrossman" wrote in message ... I have created a form. I now want to create a command button that opens a report but only with the record (with detail records in subform) to populate the report. Everytime I create the report, it brings in all records not the one that is on the screen. That is the only record that I want to appear on the report. I would then click on the commad button and the report would open up with that record only. Many thanks in advance. |
#4
|
|||
|
|||
Create a report from form
"Jeff Boyce" -DISCARD_HYPHEN_TO_END wrote
2. Modify the way your form loads its records so it only loads one. Send that to print. Just to clarify... I believe Jeff means that you must change the Form's Recordsource so it retrieves only the one Record you want to Print; if you just see one Record because the Form is in single-form view, but the Recordsource includes additional Records, all will be printed if you Print the Form. Larry Linson Microsoft Access MVP |
#5
|
|||
|
|||
Create a report from form
1. Create a report, with the layout you need for print. Add a command
button from the form to open THAT report, and send along the ID of the record being viewed on the form. See Access HELP for the exact syntax of: DoCmd.OpenReport ,,,, Yes, that's correct but Jeff recpmmended approach #1 PC Datasheet Providing Customers A Resource For Help With Access, Excel And Word Applications "Larry Linson" wrote in message ... "Jeff Boyce" -DISCARD_HYPHEN_TO_END wrote 2. Modify the way your form loads its records so it only loads one. Send that to print. Just to clarify... I believe Jeff means that you must change the Form's Recordsource so it retrieves only the one Record you want to Print; if you just see one Record because the Form is in single-form view, but the Recordsource includes additional Records, all will be printed if you Print the Form. Larry Linson Microsoft Access MVP |
Thread Tools | |
Display Modes | |
|
|