Hi All and thanks for taking a look at my problem,
Im trying to programmatically change the Unicode compression setting in my tables but can't seem to get it to work.
Here's what I'm doing:
Dim I As Integer, J As Integer
Dim db As DAO.Database, td As TableDef, fld As Field
Set db = CurrentDb()
On Error Resume Next
For I = 0 To db.TableDefs.Count - 1
Set td = db(I)
For J = 0 To td.Fields.Count - 1
Set fld = td(J)
If (fld.Type = DB_TEXT Or fld.Type = DB_MEMO) Then
fld.Properties("UniCodeCompression") = True
End If
Next J
Next I
MsgBox "Done"
db.Close
The code runs fine but the Unicode compression setting won't change, I did think it worked once and I think the first table changed but am not sure now as none of the others will change. I have used msgbox to check that it's looping correctly and everything seems fine except that the property won't change. I've about 150 tables.
Thanks in advance, Rachael
Im trying to programmatically change the Unicode compression setting in my tables but can't seem to get it to work.
Here's what I'm doing:
Dim I As Integer, J As Integer
Dim db As DAO.Database, td As TableDef, fld As Field
Set db = CurrentDb()
On Error Resume Next
For I = 0 To db.TableDefs.Count - 1
Set td = db(I)
For J = 0 To td.Fields.Count - 1
Set fld = td(J)
If (fld.Type = DB_TEXT Or fld.Type = DB_MEMO) Then
fld.Properties("UniCodeCompression") = True
End If
Next J
Next I
MsgBox "Done"
db.Close
The code runs fine but the Unicode compression setting won't change, I did think it worked once and I think the first table changed but am not sure now as none of the others will change. I have used msgbox to check that it's looping correctly and everything seems fine except that the property won't change. I've about 150 tables.
Thanks in advance, Rachael