By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,117 Members | 1,093 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,117 IT Pros & Developers. It's quick & easy.

Code to add a text field not picking up size

P: n/a
CurrentDb.Execute ("ALTER TABLE tblMyTable ADD MyNewField Text 25")

The above line does not pick up the 25 size, but instead makes it 255.
What am I doing wrong?

dixie
Aug 12 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
rkc
Dixie wrote:
CurrentDb.Execute ("ALTER TABLE tblMyTable ADD MyNewField Text 25")

The above line does not pick up the 25 size, but instead makes it 255.
What am I doing wrong?
Enclose the size in parenthesis.
Aug 12 '06 #2

P: n/a
Dixie wrote:
CurrentDb.Execute ("ALTER TABLE tblMyTable ADD MyNewField Text 25")

The above line does not pick up the 25 size, but instead makes it 255.
What am I doing wrong?
Try this:

CurrentDb.Execute "ALTER TABLE tblMyTable ADD COLUMN MyNewField TEXT(25)"

--
'---------------
'John Mishefske
'---------------
Aug 13 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.