In the following code (which I modified with the help of Rick Sprague)...when it hits "Msgbox fld.value" (green below), I get
Run-time error 3219.
Invalid operation.
MsgBox fld.Value
Any suggestions?
I was getting the error when it hit the function originally, so I put the message box in there to try and isolate the problem. I guess the problem's with "fld.value".
Thank you for your help.
Mike Kemp
Run-time error 3219.
Invalid operation.
Code:
===========================================================
Sub ParseDBField()
Dim db As Database, rst As Recordset, tdf As TableDef, x As Integer, y As String
Dim fld As Field
Set db = CurrentDb
Set tdf = db.TableDefs("ControlProperties")
Set fld = tdf.Fields("Tip")
Set rst = tdf.OpenRecordset(dbOpenDynaset)
x = 1
Code:
Do Until rst.EOF
rst.MoveFirst
If asc_code(fld, x) >= 65 And asc_code(fld, x) <= 90 Or asc_code(fld, x) >= 97 And asc_code(fld, x) <= 122 Then
y = y & Mid(fld.Value, x, 1)
Else
y = y & " "
End If
Loop
End Sub
===========================================================
Public Function asc_code(fld As Field, x As Integer)
asc_code = Asc(Mid(fld.Value, x, 1))
End Function
I was getting the error when it hit the function originally, so I put the message box in there to try and isolate the problem. I guess the problem's with "fld.value".
Thank you for your help.
Mike Kemp