Change a make table fields data type through code
Change a make table fields data type through code
(OP)
I have a table that is created and dropped each week. It is used as an export to populate and update fields in another program. Unfortunately one table has the field as a memo and the table it is going in is a number data type. I manual change the datatype of the memo field to number before I export it. Because I have to manually do this, I have to run this report every week instead of allowing the user to just fill in the date fields and click a button. I would like to automate this process. Is there a way I can write code to change the datatype prior to an automatice export?
Thank you
Micki
Thank you
Micki
RE: Change a make table fields data type through code
Where and how is it created now?
Have fun.
---- Andy
RE: Change a make table fields data type through code
CODE
RE: Change a make table fields data type through code
CODE --> SQL
Duane
Hook'D on Access
MS Access MVP
RE: Change a make table fields data type through code
RE: Change a make table fields data type through code
Micki
RE: Change a make table fields data type through code
What have you tried in order to trouble-shoot?
Are you seeing numbers in the datasheet view of the query?
Duane
Hook'D on Access
MS Access MVP
RE: Change a make table fields data type through code
RE: Change a make table fields data type through code
Is the [DUMP] table structure always the same? If so, why not delete all the records and then append?
Duane
Hook'D on Access
MS Access MVP
RE: Change a make table fields data type through code
I do not append because it will not append a memo field into a number field. I get an error. "datatype mismatch" . In order to bring the text file into the new system it runs a canned workflow process. I have no control on how it works. I just know that if I export the table with the field as a memo field it errors out. I must change the datatype to a number field prior to exporting to text file and then it works fine.
RE: Change a make table fields data type through code
"Syntax Error in ALTER TABLE statement"
My code is as follows"
CODE
I have tried int, plain number etc. I keep getting the same results. If I manually change it from memo to number it works fine without any errors.
RE: Change a make table fields data type through code
Duane
Hook'D on Access
MS Access MVP
RE: Change a make table fields data type through code
Cint(dbo_tblApHistHeader.Notes) as TheNotes
with this ?
Val(dbo_tblApHistHeader.Notes) as TheNotes
Hope This Helps, PH.
FAQ219-2884: How Do I Get Great Answers To my Tek-Tips Questions?
FAQ181-2886: How can I maximize my chances of getting an answer?