I am trying to cycle through all of the rows in a field (field ='Comments') and return the number of characters of that cell. The field is a memo type.
Could you please help with my module code. It does not like the following line:
length = Len(fld(i))
Here is the code:
Dim dbs As Database, fld As Field, tbl As TableDef
Dim i As Integer, count As Integer, length As Integer, mem As String
Set dbs = CurrentDb()
Set tbl = dbs.TableDefs![Filtered]
Set fld = tbl.Fields![Comment]
count = tbl.RecordCount
Debug.Print count
For i = 0 To (count - 1)
length = Len(fld(i))
Debug.Print length
Next i
Could you please help with my module code. It does not like the following line:
length = Len(fld(i))
Here is the code:
Dim dbs As Database, fld As Field, tbl As TableDef
Dim i As Integer, count As Integer, length As Integer, mem As String
Set dbs = CurrentDb()
Set tbl = dbs.TableDefs![Filtered]
Set fld = tbl.Fields![Comment]
count = tbl.RecordCount
Debug.Print count
For i = 0 To (count - 1)
length = Len(fld(i))
Debug.Print length
Next i