Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: Increase field's size


Message #1 by "Tim Maher" <tim.maher@s...> on Fri, 28 Feb 2003 11:29:27 +0000
Hi

I have a some code which alters the format of a text field.  After the
string has been changed I use the following statement to update the new
field:

rs.Edit
rs.Fields("DOB").Value = new_date       
rs.Update

My problem is that the new string increaes by 3 characters and the
original field is set tp eight.

Any ideas how to reset the field size before I update it?????

Ta!!

Tim
This e-mail transmission is strictly confidential and intended solely 
for the person or organisation to who it is addressed.  It may contain 
privileged and confidential information and if you are not the 
intended recipient, you must not copy, distribute or take any action 
in reliance on it.  
If you have received this email in error, please notify us as soon as 
possible and delete it.
This e-mail has been scanned using Anti-Virus software, however, 
Swansea NHS Trust accept no responsibility for infection caused by 
any virus received on the recipients system.



Message #2 by "Gregory Serrano" <SerranoG@m...> on Fri, 28 Feb 2003 13:11:06
Tim

<< rs.Edit
rs.Fields("DOB").Value = new_date       
rs.Update

My problem is that the new string increaes by 3 characters and the
original field is set tp eight.

Any ideas how to reset the field size before I update it????? >>

If you set the field's data type for DOB as Date and not as Text, that 
will eliminate your problem.  It won't matter what date you enter and what 
format you decide to show it in.  It will always "fit."

Greg
Message #3 by "Gerald, Rand" <RGerald@u...> on Fri, 28 Feb 2003 11:15:52 -0600
Hi Tim,

Execute the following SQL:

ALTER TABLE tablename ALTER COLUMN DOB TEXT(11)

The field/column size will become 11 characters.

You can use a DoCmd.RunSQL "ALTER TABLE tablename ALTER COLUMN DOB 
TEXT(11)"
statement to do it.

Rand E. Gerald
Database Specialist
Information Services / Operations
Bah=E1'=ED National Office
1233 Central St.
Evanston, IL  60201
(xxx) xxx-xxxx

-----Original Message-----
From: Tim Maher [mailto:tim.maher@s...]
Sent: Friday, February 28, 2003 05:29
To: Access
Subject: [access] Increase field's size

Hi

I have a some code which alters the format of a text field.  After the
string has been changed I use the following statement to update the new
field:

rs.Edit
rs.Fields("DOB").Value =3D new_date     
rs.Update

My problem is that the new string increaes by 3 characters and the
original field is set tp eight.

Any ideas how to reset the field size before I update it?????

Ta!!

Tim
This e-mail transmission is strictly confidential and intended solely
for the person or organisation to who it is addressed.  It may contain
privileged and confidential information and if you are not the
intended recipient, you must not copy, distribute or take any action
in reliance on it.
If you have received this email in error, please notify us as soon as
possible and delete it.
This e-mail has been scanned using Anti-Virus software, however,
Swansea NHS Trust accept no responsibility for infection caused by
any virus received on the recipients system.





  Return to Index