I am adding a text field to a temporary table using the following vb..
strSQL = "ALTER TABLE [TBL_TmpMonitorIn] ADD COLUMN [DupeCode]CHARACTER;"
CurrentProject.Connection.Execute strSQL
and then subsequently giving it a value like this..
strSQL = "UPDATE [TBL_TmpMonitorIn] SET DupeCode = [NumberOrName] & [Postcode] & str([MeasureCategory]);"
CurrentProject.Connection.Execute strSQL
[MeasureCategory] is a number, [NumberOrName] and [Postcode] are text
I end up with the [DupeCode] field padded with trailing whitespace so that in each record [DupeCode] is 255 characters long
Whats even stranger is that a subsequent UPDATE using Trim() or RTrim()
i.e.
strSQL = "UPDATE [TBL_TmpMonitorIn] SET DupeCode = RTrim([DupeCode]);"
CurrentProject.Connection.Execute strSQL
won't remove this whitespace.
This is driving me mad because the trainling spaces screw up any attempt to use that [DupeCode] as a linking field in queries.
Also building [DupeCode] on the fly in a query is appears to work as expected (no trailing spaces) but is ridiculously slow
strSQL = "ALTER TABLE [TBL_TmpMonitorIn] ADD COLUMN [DupeCode]CHARACTER;"
CurrentProject.Connection.Execute strSQL
and then subsequently giving it a value like this..
strSQL = "UPDATE [TBL_TmpMonitorIn] SET DupeCode = [NumberOrName] & [Postcode] & str([MeasureCategory]);"
CurrentProject.Connection.Execute strSQL
[MeasureCategory] is a number, [NumberOrName] and [Postcode] are text
I end up with the [DupeCode] field padded with trailing whitespace so that in each record [DupeCode] is 255 characters long
Whats even stranger is that a subsequent UPDATE using Trim() or RTrim()
i.e.
strSQL = "UPDATE [TBL_TmpMonitorIn] SET DupeCode = RTrim([DupeCode]);"
CurrentProject.Connection.Execute strSQL
won't remove this whitespace.
This is driving me mad because the trainling spaces screw up any attempt to use that [DupeCode] as a linking field in queries.
Also building [DupeCode] on the fly in a query is appears to work as expected (no trailing spaces) but is ridiculously slow