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
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