I am trying to write a bit of error proofing code in one of our databases. We receive a spreadsheet regularly from our primary customer that we import into a table and run various reports on.
One of the fields on their spreadsheet is "Purch#Doc#". Part of my error proofing is to run an SQL ALTER TABLE command on some of the table fields setting their type to text. However, when I try to run the code on the Purch#Doc# field, I get the error:
Run-time error '3292': Syntax error in field definition.
I'm sure it has to do with the pound signs in the field name, as the other fields I run the code on works perfectly.
This is the code:
Anyone have any ideas on what I can do to handle this situation?
Thanks!
Brooks Tilson
Database Development
Tilson Machine, Inc.
One of the fields on their spreadsheet is "Purch#Doc#". Part of my error proofing is to run an SQL ALTER TABLE command on some of the table fields setting their type to text. However, when I try to run the code on the Purch#Doc# field, I get the error:
Run-time error '3292': Syntax error in field definition.
I'm sure it has to do with the pound signs in the field name, as the other fields I run the code on works perfectly.
This is the code:
Code:
DoCmd.RunSQL "ALTER TABLE tSAP ALTER COLUMN Purch#Doc# text"
Anyone have any ideas on what I can do to handle this situation?
Thanks!
Brooks Tilson
Database Development
Tilson Machine, Inc.