Results 1 to 4 of 4
  1. #1
    Red Kenny is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jul 2018
    Posts
    2

    Find & Replace Table source data?

    Hello,

    A question please.

    I have a query referencing a source table, but I would like to copy my query to keep all the layout and format but change the source table to an identical table, but with a different name and data. Is this possible?

    To go into more detail I want to keep the entire query design for my sales table but change the source data to the previous year's sales table.

    Thank you.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,526
    It doesn't make sense to change the source.
    if I say my source is table1, why would the code change it to table2, when I want 1?

  3. #3
    Red Kenny is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jul 2018
    Posts
    2
    Quote Originally Posted by ranman256 View Post
    It doesn't make sense to change the source.
    if I say my source is table1, why would the code change it to table2, when I want 1?
    To keep the exact same format of the query, column for column, rule for rule to table 2. I.e. to save the hassle of design the same query 5 times.

  4. #4
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,122
    Why have a sales table for each year? Why not put them together in one single table and add a Year field (or simply use Year(SalesDate) in your query to limit the year to the year part of the date of sale). Any way, if you want to replace the source table the easiest I found is to copy the SQL statement of your query to Word or Notepad and in there do a Replace All for Table1 with Table2. You could also do it in VBA by editing the SQL property of the querydef.

    Cheers,
    Vlad

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Change Table name with Find/Replace
    By QuantifyRisk in forum Modules
    Replies: 4
    Last Post: 11-04-2016, 11:13 PM
  2. Replies: 3
    Last Post: 04-27-2016, 01:25 PM
  3. Replies: 10
    Last Post: 11-16-2012, 05:02 AM
  4. Find and replace tabs from data
    By mentose457 in forum Access
    Replies: 9
    Last Post: 12-06-2010, 09:11 AM
  5. Find and Replace query from a 2nd table
    By elightbox in forum Queries
    Replies: 1
    Last Post: 09-17-2010, 05:37 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums