Any way to avoid access auto changeing my query?

J

jy_ty_st

I have tables which use number as column due to a reason. There is no
problem for this in both Access queries and VBA as long as I wrote the
number field name, say, 058 as [058] in the queries on VBA. until when
I write a query:

"Insert into [table1 name] ([058], [other field name],...) select
( ...) from [table2 name]"

The Access automatically change my query into "Insert into [table1
name] (058, [other field name],...) select ( ...) from [table2 name]"
after saving the query

Is there a way to avoid this automatically change?

Thanks a lot,

James
 
V

vbasean

I have tables which use number as column due to a reason. There is no
problem for this in both Access queries and VBA as long as I wrote the
number field name, say, 058 as [058] in the queries on VBA. until when
I write a query:

"Insert into [table1 name] ([058], [other field name],...) select
( ...) from [table2 name]"

The Access automatically change my query into "Insert into [table1
name] (058, [other field name],...) select ( ...) from [table2 name]"
after saving the query

Is there a way to avoid this automatically change?

Thanks a lot,

James

[058].[table name]
 
D

Dirk Goldgar

Dirk Goldgar said:
vbasean said:
[058].[table name]

Shouldn't that be

[table name].[058]

?


Hmm, I don't think this works, either. On the other hand, it seems to me
that the original SQL, as transformed by the query designer, does work. So
I'm not sure what the problem is.
 
J

jy_ty_st

Shouldn't that be
   [table name].[058]

Hmm, I don't think this works, either.  On the other hand, it seems to me
that the original SQL, as transformed by the query designer, does work.  So
I'm not sure what the problem is.

Thank you, vbasean and Dirk. But [table 1].[058] will automatically
become [table 1].058. in Access 2003. If no way to solve the problem,
I have to rewite and retest a lot, Help please!
 
J

jy_ty_st

J

John W. Vinson

Thank you, vbasean and Dirk. But [table 1].[058] will automatically
become [table 1].058. in Access 2003. Can someone help me!

One thing to try - and I can't be sure it will work! - is to open the query in
SQL view; edit it to put in the brackets; and save the query *from the SQL
window*. If you do not go to the Query Grid window, *or* ever open the query
in query grid design view, it should preserve your SQL.

Again, no guarantees, but it's worth a try.
 
J

jy_ty_st

Thank you, vbasean and Dirk. But [table 1].[058] will automatically
become [table 1].058. in Access 2003. Can someone help me!

One thing to try - and I can't be sure it will work! - is to open the query in
SQL view; edit it to put in the brackets; and save the query *from the SQL
window*. If you do not go to the Query Grid window, *or* ever open the query
in query grid design view, it should preserve your SQL.

Again, no guarantees, but it's worth a try.

Thank you John, but I used SQL window.
I just put the query into VBA code, it's okay now.
Thank you everyone.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top