Re: Saving changes on form before running a report
- From: fredg <fgutkind@xxxxxxxxxxxxxxx>
- Date: Mon, 17 Oct 2005 16:30:05 -0700
On Mon, 17 Oct 2005 15:29:01 -0700, iholder wrote:
> I would like to save changes to the form without using a separate [Save]
> command button.
>
> Using a macro. [Tried]
> Save
> ReQuery - [Control Name]
> OpenReport - [Report name]
>
> This does not work.
>
> The changes are not reflected when I run the report.
>
> Help greatly appreciated.
It's easy to use some code.
On the Command button (that you already use to open the report)
On Click event line, enter
[Event Procedure]
Then click on the little button with the 3 dots that will appear on
that line.
When the code window opens, the cursor will be flashing between 2
already existing lines of code.
Between those 2 lines, write:
DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport "ReportName", acViewPreview
Change "ReportName" to whatever your actual report name is (surrounded
with the quotes as above).
Exit the code window. When you enter data and press the command button
the data is saved and the report will open in Preview. If you wish to
print the report without preview, change acViewPreview to
acViewNormal.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
.
- Prev by Date: removing the blank entry from a combo box?
- Next by Date: Re: Combo Box list based on choice selections
- Previous by thread: removing the blank entry from a combo box?
- Next by thread: Re: Combo Box list based on choice selections
- Index(es):
Relevant Pages
|