I am getting the record size using rdo in the following way..
intFieldSize = rdoConnect.rdoTables(tblName).rdoColumns.Item(i).Size
I am passing the size value to the function below to ensure that the element I want to insert into the database does not exceed the record size. However, many records are being prompted that they are too big, but they are still being inserted into the database? Am I doing something wrong? Is there a better way of doing this?
Public Function cmdTrimLength(strString As Variant, intSize As Long, intType As Integer) As String
Dim intTestStringLen As Integer
Dim intInteger As Integer
Select Case intType
Case intType = -6 Or intType = -2
intInteger = CInt(strString)
If Len(intInteger) > 1 Then
strString = Left$(strString, 1) ' SubString does not exceed recordLength
MsgBox "Field length too large!", vbCritical
If Len(strString) - 2 > intSize Then
strString = Left$(strString, intSize)
MsgBox "RECORD LENGTH WAS TOO BIG!", vbCritical
cmdTrimLength = strString