Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Field/Column Name Automatically Renamed 1

Status
Not open for further replies.

accessjack

Programmer
Dec 2, 2004
28
US
While in query design view, I am trying to rename a column/field name to Adj-01 (see formula below; This works fine, however, when I save and exit the query, and then go back in, access renames the column/field name to Adj-1. The "0" gets ommitted. Since I am using the precise field name in a later query, this gives an error. Any idea why access is doing this.

Adj-01: IIf(IsNull([tblBalance-Adj]![01])=True,[tblBalance-]![01],[tblBalance-Adj]![01])

 
Have you tried this ?
[!][[/!]Adj-01[!]][/!]: IIf(IsNull([tblBalance-Adj]![01])=True,[tblBalance-]![01],[tblBalance-Adj]![01])

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Yes. I tried the bracket. I got the following error message: [Adj-01] is not a valid name. Make sure that is does not include invalid characters or punctuation and that it is not too long.
 
If you save it in the SQL view with the column named [Adj-01] then it keeps the correct column name formatting between uses.

Hope that helps

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
Thanks, it worked when I saved it in SQL view. I never would have thought of that.
 
Glad I could help, thanks for the star [smile]

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
HarleyQuinn,
It worked when I did it, but when I try to run the query a little later, it did revert back again. It's weird, it's like the changes keep when I save, close & rerun the query, but when I run the subsequent query which uses the 1st query above as it's source, it just changes the field names back again. I can't figure it out.
 
That is strange, it seems to stick for me when I base a query on it. Not sure to be honest.

Sorry I can't be of more help [sad]

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top