VBA to change header text

ggodwin

Registered User.
Local time
Today, 13:46
Joined
Oct 20, 2008
Messages
112
I am attempting to change header text on a recently imported table using VBA.

I have a Table (Name is "Report")
In my header I have a field that has this as the header
QPR/QPI Number

Access does not like special Characters such as the "/" and the " " that is between the word QPI and Number.

I need a simple code that will remove both of these from this field header.

(I have several fields like this but I think I can apply the syntax to the others.)
 
I think you are asking about the field name when you say header. Is this correct.

Note" to reference a field name with a space or other character use [ and ] like this [QPR/QPI Number]. Then you do not have to rename the field.
 
Yes, I am talking about renaming Field Names.

I am not sure what you are saying in your secound part of the reply?
What do you mean I don't need to rename the fields?
 
What do you mean I don't need to rename the fields?

If you can import the data and Access uses these names to create a table, then Access does like the field names.

It is possible to rename the fields with VBA code. I have has to use VBA code to update remote databases before. If you are correct that that Access does not really like the field names, then it would not like the field names in the VBA code either. :confused:

If it were me, I would import data into a temp table, then use an append query to add the data to a tbale with the field names of your choice.

Also note: Report is probably a reserved word and should be avoided for user named objects.
 
Last edited:
You can download and use V-Tools (free). It has Total Deep Search, which can replace names with whatever you want for whichever objects you select.

I would also turn off the Name Auto Correct as it can corrupt things.

You can get V-Tools here: http://www.skrol29.com/dev/en_vtools.htm
 
If it were me, I would import data into a temp table, then use an append query to add the data to a tbale with the field names of your choice.

This is the way I went and it seems to be working good. I also downloaded the addin mentioned above. It appears to have some useful tools.

Thanks!
 
This is the way I went and it seems to be working good. I also downloaded the addin mentioned above. It appears to have some useful tools.

Thanks!

You're welcome!

Glad Bob and I could assist. :)
 

Users who are viewing this thread

Back
Top Bottom