Table name changed, how do I...

J

Jason Gyetko

I had to change the name of a couple tables to get rid of a space in the
name Ex: Table One = Table_One.

I searched through all the code and replaced it accordingly, but all my
forms, queries, & macros still have the old name. Is there a way to search
and replace in them as well, or do I have to manually go through and do it?
Thanks.
 
S

Steve Huff

What version of Access are you using? Access 2000 and above should fix this
for you automatically unless you turn the option off (Tools -> Options ->
General "Track Name Autocorrect Info" and "Perform name AutoCorrect"). If
you are using Access 97 or below you must change it by hand. You could write
code to do it but that would probably take longer then doing it by hand -
unless you can find an add in for it. I have code that will search forms and
queries but not make changes in them.

--Steve Huff
 
J

Jason Gyetko

Thanks, they were disabled.

I enabled them, but my frontend application has all linked tables. Is that
still supposed to work if I make changes to the backend access DB? It looks
like it does not, so I exported all the tables into my frontend db instead
of using the links, then made the changes to the tables. I found that it
made the appropriate change in one form, but most of my stuff did not get
modified.

Can I get the code you have to search the forms and queries so I can see
what didn't get updated?
 
J

Jason Gyetko

Access 2000

Steve Huff said:
What version of Access are you using? Access 2000 and above should fix this
for you automatically unless you turn the option off (Tools -> Options ->
General "Track Name Autocorrect Info" and "Perform name AutoCorrect"). If
you are using Access 97 or below you must change it by hand. You could write
code to do it but that would probably take longer then doing it by hand -
unless you can find an add in for it. I have code that will search forms and
queries but not make changes in them.

--Steve Huff
 
J

John Vinson

T

Tom Wickerath

Hi Jason,

Just a quick comment to explain your observation regarding NameAutocorrect:

"I found that it made the appropriate change in one form, but most of my stuff did not get
modified."

In order for NameAutocorrect to even attempt to function correctly, the name maps must be
up-to-date in your database before you attempt to rename a field, table or query. The name maps
were likely not up-to-date since you had already disabled this most buggy feature (a good
thing!). In order to update the name maps, you need to first turn NameAutocorrect back on. Then
open each object (tables, queries, forms, reports) in design view, and click on the save button.
Do this before you attempt to rename anything. Then, you'll have a reasonable chance of success
with NameAutocorrect.

The same procedure is required for databases that have been converted from the Access 97 format
to the Access 2000 format, since there would be no associated name map in a converted database.

Tom

____________________________________


Thanks, they were disabled.

I enabled them, but my frontend application has all linked tables. Is that
still supposed to work if I make changes to the backend access DB? It looks
like it does not, so I exported all the tables into my frontend db instead
of using the links, then made the changes to the tables. I found that it
made the appropriate change in one form, but most of my stuff did not get
modified.

Can I get the code you have to search the forms and queries so I can see
what didn't get updated?
 
Top