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 Programming / May 2007

Tip: Looking for answers? Try searching our database.

Write / Print Same Record

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ripper - 30 May 2007 20:44 GMT
I have a subForm populated from a main form, but I only write the record if
specific conditions are met.  Once they are met though, I want the user to
click a button on the subform and add the record and print that specific
record at the same time.

I was trying to use AddNewRec, but I can't do that because once they add the
record that way, the subForm clears and the button gives an error message.  
Is there a way to update the table and print that same record?  For example
instead of an AddNewRecord, is there an UpdateTable or and UpdateNewRecord?

Any help would be appreciated.
Signature

Thanks As Always
Rip

John W. Vinson - 30 May 2007 23:50 GMT
>I have a subForm populated from a main form, but I only write the record if
>specific conditions are met.  Once they are met though, I want the user to
[quoted text clipped - 5 lines]
>Is there a way to update the table and print that same record?  For example
>instead of an AddNewRecord, is there an UpdateTable or and UpdateNewRecord?

AddNewRecord does just that - it stops what you are doing and adds a new
(blank) record.

To save the current record to disk use

If Me.Dirty Then Me.Dirty = False

or

DoCmd.RunCommand acCmdSaveRecord

You can then use the OpenReport method to open a report to print the record;
use the optional WhereCondition argument to pass a unique ID to specify which
record should be printed.

            John W. Vinson [MVP]
 
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.