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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

change fieldsize property

Status
Not open for further replies.

rjmdt

Programmer
May 17, 2002
38
0
0
US
I have a make table query that makes a fieldsize that is too large. I only need a property of 10 and it is making the size 255. It is causing problems with reports and indexes. How can I change the fieldsize property within a query or macro or code?

Thanks
 
Hi rjmdt,

This example will change the field MyTextField in Table1 to 10:

Dim strSQL As String
DoCmd.SetWarnings False
strSQL = "ALTER TABLE Table1 ALTER COLUMN MyTextField TEXT(10);"
DoCmd.RunSQL (strSQL)
DoCmd.SetWarnings True

Bill
 
The Alter Column is not a valid syntax with my version of Access 97.

Thanks
 
I am a SQL newbie but I hope that I am giving you some leads on your research:

Can you use the DROP COLUMN and then ADD COLUMN in A97?



Is there a way to delete a column in a table in VBA?
thread707-604549
(This has some info on looking up the correct syntax in A97.)


"The nice thing about being a celebrity is that when you bore people, they think it's their fault." - Henry Kissinger
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top