Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
| Search | Today's Posts | Mark Forums Read
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA 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
  #1 (permalink)  
Old October 4th, 2004, 10:10 AM
Authorized User
 
Join Date: Mar 2004
Location: , , .
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default How can I merge two databases and tickets tables?

The basic code I have as below, to merge Tickets1 table into Tickets table, provided you brought in Tickets1 via Get External Data..

How would I merge database on c:\dir1\event.mde (table tickets) into f:\dir3\subdir\event.mde (table tickets)?


Private Sub Command1_Click()
''INSERT INTO maintable SELECT * from temptable WHERE someidfield NOT IN (select someidfield FROM maintable)
Dim strLogs As String

strLogs = "INSERT INTO [Tickets] SELECT * FROM [Tickets1] WHERE [TicketID] NOT IN (SELECT [TicketID] FROM [Tickets]);"
DoCmd.RunSQL strLogs
End Sub

aCk!
__________________
aCk!
  #2 (permalink)  
Old October 4th, 2004, 12:58 PM
Authorized User
 
Join Date: Mar 2004
Location: , , .
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I found out I could do the TransferDataBase and export, but it replaces the table instead of merging them..

help please.

aCk!
  #3 (permalink)  
Old October 5th, 2004, 01:07 PM
Authorized User
 
Join Date: Apr 2004
Location: Montreal, Quebec, Canada.
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to lguzman
Default

You should link one of your tables in the other database file. Create a append query. This should allow you to append the records from table A into table B.

[LGuzman]


Similar Threads
Thread Thread Starter Forum Replies Last Post
merge Records from 2 databases keturpatel Access VBA 4 September 22nd, 2007 09:56 AM
DataSet - Merge Data Tables srish ADO.NET 0 September 8th, 2007 10:04 AM
Need to merge several tables with unlike structure CORiverRat Access 5 December 14th, 2005 12:58 PM
Whether or not to merge two tables chrislepingwell SQL Language 1 November 24th, 2005 06:18 PM
How to Merge Tables into one query sorcerer Access 5 March 11th, 2005 04:19 AM





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