Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / January 2006

Tip: Looking for answers? Try searching our database.

Saving changes on form before running a report

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
iholder - 17 Oct 2005 23:29 GMT
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.
fredg - 18 Oct 2005 00:30 GMT
> I would like to save changes to the form without using a separate [Save]
> command button.
[quoted text clipped - 9 lines]
>
> 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.
Signature

Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

iholder - 18 Oct 2005 14:41 GMT
Thank You Fred

This works perfect.

Ileana

> > I would like to save changes to the form without using a separate [Save]
> > command button.
[quoted text clipped - 30 lines]
> print the report without preview, change acViewPreview to
> acViewNormal.
Vivi - 25 Jan 2006 21:52 GMT
Hello.  I have similar question but vis versa.
I found before the " save"  command button was hit, any record changes save
to the table already.  Do I have any way to prevent this, let the update
record can only be saved after the "save" command button is pressed???

> > I would like to save changes to the form without using a separate [Save]
> > command button.
[quoted text clipped - 30 lines]
> print the report without preview, change acViewPreview to
> acViewNormal.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.