Results 1 to 7 of 7
  1. #1
    Numpty is offline Novice
    Windows XP Access 2003
    Join Date
    Feb 2019
    Posts
    8

    Change field name process

    Hi all.
    I use access 2003(never got around to upgrading to 2010 due to coding issues) with dB which has been built adhoc over 20 years.

    Some fields have bad names, and looking for a method to :
    1.Find where each field is referenced in queries, controls, reports, macros, vba, and calculated 'textboxes'
    2. Edit the name in table & propagate that edit like with a find&replace function.

    The scale of the problem:


    At the very start, 'date' was used as a field name which confuses on vba(just one example)
    I have 8 tables, 72 queries, 120 forms & countless calculations & command buttons reliant on field data.
    To change a name in the past, a new field was made with correct name, data copied, and old field then renamed/attributes edited to suit another function.
    This version of access does not propagate name changes successfully ('materials' textbox changed to 'materials2' within report will propagate to calculations on same report, but fails to read that original textbox even though its control source is unchanged)
    If I export the dB analyser, it tells me names, but not the calculations, macros & vba code.

    Is there any function to analyse dB only returning field names, and where fields are referenced, maybe to show control content of textboxes & buttons
    Or
    A simple program to find & replace throughout a dB?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    changing field names could crash other things; queries , forms, etc.
    you CAN use DATE as a field, and access will warn you not to, but you can.
    Be sure to differentiate on forms so objects know its me.date and not Date()

    if it aint broke, don't fix it.

  3. #3
    Minty is offline VIP
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    There are some things that can help you - VTools http://www.skrol29.com/us/vtools.php is apparently pretty good.

    I use MZ-Tools https://www.mztools.com/ both have powerful search and replace options I believe.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  4. #4
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,791
    Definitely don't try anything with at least a couple of backup db's, and I would have at least one on some other media such as a stick or cd-r. It's not hard to think you're in one copy only to find you've just messed with a backup. Tend to agree with 'if it ain't broke' thing, unless it's causing issues, and you'd have to weigh those against the prospect of redesigning it. If you don't find a suitable freeware or open source tool and can't get approval to purchase, you'll have to be good at searching and adapting code, and it will take time.
    I started to write procedures to find all traces of keywords in things like sql; can't recall exactly where I left off. Had it working to the point where it would find a phrase or keyword in any query or control rowsource, then moved on to looking at tables. I dropped it because it became apparent that the potential paid job where I would use it didn't pan out. It will be a big task if you take it on yourself.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    MikeKincaid is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2019
    Posts
    2
    This works really well as a "addin" for Access. Rick Fisher's Find and Replace for Access.

    http://www.rickworld.com/products.html

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Post 5 was moderated, I'm posting to trigger email notifications. I'll add that I've heard great things about Rick's tool but also that he seems to have stopped supporting it. More info on that and other options:

    https://www.devhut.net/2017/03/31/gr...d-and-replace/
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,791
    Looks like a slick tool but the link is a pointer to UA. You have to be registered there. I guess that's the price for a free tool

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

Similar Threads

  1. Replies: 4
    Last Post: 05-14-2018, 06:05 PM
  2. Replies: 17
    Last Post: 11-03-2017, 08:20 AM
  3. Replies: 2
    Last Post: 07-13-2017, 10:44 AM
  4. Replies: 1
    Last Post: 06-25-2016, 02:00 PM
  5. Replies: 3
    Last Post: 07-20-2012, 11:41 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