Results 1 to 4 of 4
  1. #1
    Dan..'s Avatar
    Dan.. is offline Novice
    Windows 10 Office 365
    Join Date
    Feb 2021
    Location
    Huntsville, AL
    Posts
    3

    Updated field name in table did not propagate to table alias in query (but did to original table).

    I decided to change some field names in a table that was already feeding a query. In this particular query, I was using the table twice, once with an index on one situation and again with an index to another situation.
    When adding a second table to the query, Access automatically creates an alias by appending _1 to the table name.

    After I changed the field names in the underlying table, the field names in query were updated EXCEPT for the table with an alias name!

    I tried using an alias name that was different from the Access default, but got the same result.

    I suspect that Access could not associate the alias used in the query to the original table name, and consequently did not update the field name in the alias table.

    Is there a way to generate a second instance of a table in a query such that Access will be able to identify it as an alias of the original table and update any field name changes made to the original table?

    Thanks for any suggestions you may have,
    Dan..

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    you cant add the same table more than once, it MUST create an alias for the 2nd instance.
    (and its not good to rename fields or tables once you programmed it with the old names. its a mess.)

    sometimes access knows the fields were changed and renames the instance in the queries. but not always. you may have to do it manually.

  3. #3
    Dan..'s Avatar
    Dan.. is offline Novice
    Windows 10 Office 365
    Join Date
    Feb 2021
    Location
    Huntsville, AL
    Posts
    3
    That is pretty much what I found out through experimentation.

    I was hoping that there was an elegant way to let Access know that the alias WAS for for a particular table (even if I had to do it through SQL) so that Access would propagate the change.

  4. #4
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    1,035
    In queries you can easily change the name yourself:
    - open the query in SQL view
    - do an edit-> Find and replace

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

Similar Threads

  1. Replies: 1
    Last Post: 04-17-2020, 09:01 AM
  2. Replies: 2
    Last Post: 04-15-2019, 03:11 AM
  3. Replies: 2
    Last Post: 04-28-2014, 01:38 PM
  4. Replies: 2
    Last Post: 07-25-2012, 01:01 PM
  5. Replies: 5
    Last Post: 05-02-2012, 07:56 AM

Tags for this Thread

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