I keep getting the following error message with the code below:
"Variable not defined"
The question, is how do I make the variable "fld" pass from my sub routine to my function and back again? At least, I think that's why I'm getting this error message.
Thank you for your help.
"Variable not defined"
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
Do Until rst.EOF
rst.MoveFirst
If asc_code >= 65 And asc_code <= 90 Or asc_code >= 97 And asc_code <= 122 Then
y = y & Mid(fld.Value, x, 1)
Else
y = y & " "
End If
Loop
End Sub
============================================================
Function asc_code()
asc_code = Asc(Mid(fld.Value, x, 1))
End Function
Thank you for your help.