Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Password Reminder
| FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #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

Reply With Quote
  #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

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

help please.

Reply With Quote
  #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

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.

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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

All times are GMT -4. The time now is 06:03 AM.

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