Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 19th, 2005, 08:20 AM
Friend of Wrox
 
Join Date: Jun 2005
Posts: 181
Thanks: 0
Thanked 0 Times in 0 Posts
Default Saving a record to a different location

Help
I need when saving a record in my database to be able to save the record also to a different database in a different location

I am using the following code
On Error GoTo ErrorHandler
 If IsNull(Office_Type) Or IsNull(Number_Of_Positions) Or IsNull(Helpdesk_Ref) Or IsNull(Approved_By) Or IsNull(Position) Or IsNull(Reason_For_Replacement) Or IsNull(Software_Version) Or IsNull(Requested_By) Or IsNull(Machine_Type) Or IsNull(Which_Cash_Account) Or IsNull(Comms) Or IsNull(Screen_Type) Or IsNull(Person_Spoke_To) Or IsNull(System_Running_Or_Down) Or IsNull(Priority) Then
MsgBox "All Fields are MANDATORY Except Office Contact And If Net Vista ", vbInformation, "IT Helpdesk SUR"
Else
Me.Status = "Sent"
DoCmd.RunCommand acCmdSaveRecord
DoCmd.SendObject acSendReport, "RPTSUR1", acFormatRTF, "", "[email protected]", "", " System Unit Replacement " & Office, "System Unit Replacement logged by " & Logged_By, False
Me.Status = "Closed"
emailsent = "True"
 DoCmd.RunCommand acCmdSaveRecord

 DoCmd.Close
ErrorHandlerExit:
   Exit Sub

ErrorHandler:
   MsgBox "Error No: " & Err.Number & "; Description: " & Err.Description
   Resume ErrorHandlerExit
   End If

Thanks

__________________
Brendan Bartley
 
Old July 30th, 2005, 01:40 AM
Friend of Wrox
 
Join Date: Jul 2005
Posts: 150
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Where is the code? It helps to include the SUB statement or explain when it is executed.

From the VBA code, I assume this is on the form.

You can use an append query that selects the record just saved by the primary key from the form, and then appends the record into an other table.

You can add this someplace after you have saved the record.

HTH...




Boyd
Access Based Accounting/Business Solutions developer.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Invalid Column Name error when saving record mmcdonal SQL Server 2000 2 September 5th, 2006 12:42 PM
Saving Picture file to specific Location sangeenobs VB How-To 0 December 13th, 2005 11:18 AM
EXCEL question saving a file saving the the first macupryk VS.NET 2002/2003 0 January 6th, 2005 05:33 PM
Getting the location of a Record creative_eye ADO.NET 2 May 12th, 2004 09:46 AM
Record saving slowly vonkarl SQL Server 2000 0 September 5th, 2003 10:09 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.