3163 Field is too small

  • Thread starter Thread starter deb
  • Start date Start date
D

deb

I am getting error 3163 - Field is to small...
it error at ... rs!NewValue = rstemp!NewValue

I made the related tables changes to 255 char, but when the temp table is
created it is created with only 50 char on all fields. How can I make it
create with 255 char?

thanks


Sub WriteTempTableToAuditTable()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim rstemp As DAO.Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("AuditTable")
Set rstemp = db.OpenRecordset("rAuditTemp")

Do Until rstemp.EOF
rs.AddNew
rs!TableName = rstemp!TableName
rs!RecordPrimaryKey = rstemp!RecordPrimaryKey
rs!FieldName = rstemp!FieldName
'rs!LoginName = Environ("UserName") 'requires environment variable
'rs!MachineName = Environ("computername")
rs!LoginName = GetCurrentUserName
rs!MachineName = GetComputerName
rs!User = CurrentUser 'returns Access Security name
rs!OriginalValue = rstemp!OriginalValue
rs!NewValue = rstemp!NewValue
rs!DateTimeStamp = rstemp!DateTimeStamp

rs.Update
rstemp.MoveNext
Loop

rs.Close
rstemp.Close
db.Close

Call ClearTempTable
 
I'm not sure I understand what you're trying to accomplish. You're not
creating a new table anywhere there: AuditTable and rAuditTemp both exist
before your code runs.
 
deb said:
I made the related tables changes to 255 char, but when the temp table is
created it is created with only 50 char on all fields.

Did you create your temp table with only 50 characters or are you
creating it use DAO code?

If you are using DAO code then add another parameter.
CreateField("FieldName", dbText, 255)

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
Back
Top