D
Dale
I'm trying to write a procedure to output the field names in a table, can
someone point out where I'm going wrong in A2K...as always thanks for any
enlightment!
Function GetFields()
Dim dbs As Database, rst As Recordset, fld As Field, x As Integer
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("tblMyTable")
' set the field...
Set fld = rst.Fields
' loop thru the recordset...
While Not rst.EOF
fldcount = fld.Count
For x = 0 To fldcount - 1
Field = fld.Item(x)
Debug.Print Field.Name & ", " & Field.Value
Next
rst.MoveNext
Wend
rst.Close
dbs.Close
End Function
someone point out where I'm going wrong in A2K...as always thanks for any
enlightment!
Function GetFields()
Dim dbs As Database, rst As Recordset, fld As Field, x As Integer
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("tblMyTable")
' set the field...
Set fld = rst.Fields
' loop thru the recordset...
While Not rst.EOF
fldcount = fld.Count
For x = 0 To fldcount - 1
Field = fld.Item(x)
Debug.Print Field.Name & ", " & Field.Value
Next
rst.MoveNext
Wend
rst.Close
dbs.Close
End Function