hi i need to be able to find the value of the maximum ID in a table i have using VBA. played around with a few variations but none of them seem to wok. Generally they return Syntax errors though i have tried a number of suggestions from a buch of sources.
rst.Open "Select MAX(ID) FROM Package", conn, adOpenDynamic, adLockOptimistic, adCmdTable
Sheets("New Package").Range("B13").CopyFromRecordset rst
maxi = Range("B13").Value + 1
rst.Close
rst.Open "package", conn, adOpenDynamic, adLockOptimistic, adCmdTable
Thanks!
Bookmarks