Field Lengths

smed

Registered User.
Local time
Today, 19:53
Joined
Apr 18, 2002
Messages
50
I have a problem when using an action query to make a new table.

Any fields which have additional formatting (eg. Field2: Ucase$(Field1) is automatically sets the field size to 255 in the new table, irrespective of what the original field size or the max length of the new field is.

Does anyone know how to limit the field size without going into design mode of the new table, or creating a table and using the delete and append query functions.

Any help would be appreciated.

Smed
 
I have found a solution in dbforums website using SQL

Function ChangeFieldSize()
Dim dbs As Database
Set dbs = CurrentDb
dbs.Execute "ALTER TABLE table_name ALTER COLUMN column_name CHAR(field_size);"
dbs.Close
End Function

Smed
 

Users who are viewing this thread

Back
Top Bottom