I am using access 2003. I am trying to write vba code read information from a table. I am almost finished. When using the autonumber datatype I can't figure out how to read the new Values row. This row has two values: Increment and Random. The attributes = 17 for both, the collating order = 1033 for both. I have set up a function for this and all the other properties.
Code:
Function XLFormatNewValues(ByRef D As Field, ByRef Col As String, ByRef lTbl As Integer, ByRef lRow As Integer, ByRef lFld As Integer) As String
Dim dBase As DAO.Database
Set dBase = CurrentDb
Debug.Print Err.Number
On Error Resume Next
'goXL.ActiveSheet.Range(Col & lRow) = dBase.TableDefs(lTbl).Fields(lFld).Properties("NewValues")
goXL.ActiveSheet.Range(Col & lRow) = dBase.TableDefs(lTbl).Fields(lFld).Attributes
goXL.ActiveSheet.Range(Col & lRow) = dBase.TableDefs(lTbl).Fields(lFld).CollatingOrder
'goXL.ActiveSheet.Range(Col & lRow) = dBase.TableDefs(lTbl).Fields(lFld).OriginalValue
goXL.ActiveSheet.Range(Col & lRow) = dBase.TableDefs(lTbl).Fields(lFld).Type
Debug.Print Err.Number
Debug.Print Err.Description
Err.Clear
End Function