Results 1 to 5 of 5
  1. #1
    ijo68 is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Feb 2021
    Posts
    37

    Updating control names in VBA

    Hello Everyone , as always I want to thank everyone for contributing to this forum.

    I just found out that I used some reserved words in my tables and want to correct this.
    What would be the easiest way to update the VBA code for all the reference to the corrected fields and controls.

    Thank you in advance

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    if you've already named the fields and programmed around them, its best to leave them As-Is. You'll just get errors by renaming them.
    even tho access says its reservered, its just a warning. You can have fields called: Name, Date, Note.

    Its best to avoid these names if youre starting from scratch.
    But if you DO rename them, be prepared to fix all the errors that goes with it.
    You can globally replace vba module references, but may not get every form object.
    I say Leave It. Good luck.

  3. #3
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Highlight the wrong name, which should then propagate into the find & replace dialog. Ctrl+H, choose 'current project' and click either replace or replace all. I don't recommend "replace all' unless you are absolutely sure you have provided the absolute correct 'Find' parameters. Pretty sure that writing code for this would take longer than doing it manually.
    Last edited by Micron; 02-19-2021 at 12:28 PM. Reason: correction
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    Minty is online now VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,001
    If you need to go this route, V-Tools is very good
    https://www.skrol29.com/us/vtools.php

    It can really globally search and replace.
    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 ↓↓

  5. #5
    ijo68 is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Feb 2021
    Posts
    37
    As always ..thanks for all the input... still wondering if it's worth all the hassle..

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

Similar Threads

  1. Replies: 6
    Last Post: 02-28-2015, 01:23 PM
  2. Manipulating Control Names ...
    By Nod_Swerdna in forum Access
    Replies: 6
    Last Post: 02-28-2015, 01:10 PM
  3. Replies: 3
    Last Post: 01-24-2014, 03:33 PM
  4. Replies: 3
    Last Post: 07-18-2013, 04:21 AM
  5. writing control names on a form to a table
    By focosi in forum Access
    Replies: 1
    Last Post: 09-21-2011, 08:47 AM

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