Go Back   Access World Forums > Microsoft Access Discussion > Modules & VBA

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 03-27-2019, 08:11 AM   #1
aman
Newly Registered User
 
Join Date: Oct 2008
Posts: 1,250
Thanks: 54
Thanked 3 Times in 2 Posts
aman is an unknown quantity at this point
Query to check data in old and new tables

Hi Guys,

I have created a new table which has replaced the old tables due to business needs. Now my report is not pulling through the historical data as it's pointing to the new table. How can I change my query so it will check reference number in old table and if it's there then pull through the data and if it's not then check in new table.

Can we do something similar?

Thanks

aman is offline   Reply With Quote
Old 03-27-2019, 08:16 AM   #2
theDBguy
Iím here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 6,651
Thanks: 58
Thanked 1,459 Times in 1,440 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: Query to check data in old and new tables

Hi. Just a guess but try changing your query into a UNION query.
__________________
Just my 2 cents...

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
theDBguy is offline   Reply With Quote
Old 03-27-2019, 08:16 AM   #3
pbaldy
Wino Moderator
 
pbaldy's Avatar
 
Join Date: Aug 2003
Location: Nevada, USA
Posts: 33,396
Thanks: 13
Thanked 4,124 Times in 4,056 Posts
pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold
Re: Query to check data in old and new tables

Short version, you can't. You can create a UNION query that joins the two tables together, or modify the report's record source dynamically.

__________________
Paul
Microsoft Access MVP 2007-2019

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
pbaldy is offline   Reply With Quote
Old 03-27-2019, 12:44 PM   #4
Anakardian
Newly Registered User
 
Join Date: Mar 2010
Location: Copenhagen, Denmark
Posts: 161
Thanks: 8
Thanked 25 Times in 24 Posts
Anakardian is on a distinguished road
Re: Query to check data in old and new tables

Any reason you don't want to move the old data into the new table?
that would solve the issue a lot simpler

Anakardian is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Query two tables and return all data from both tables erict Queries 6 07-27-2016 06:56 AM
ad hoc data query from form check boxes thatlem Excel 2 03-05-2010 11:24 AM
Auto fill in and check data from other tables ixusss Tables 8 03-15-2007 08:40 AM
Check query for data mrssevans Modules & VBA 7 07-06-2005 04:54 AM
Check for data in several different fields with one query pianoprodigy Queries 4 04-05-2004 10:01 AM




All times are GMT -8. The time now is 06:17 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World