This is more of an SQL question than a query issue.
I want to determine the max value of an autonumber field, b/c this is an easy way to access the last created record in a table. I can't use DoCmd.GoToRecord , , Last,
because I have a sort active on my recordset, and that navigates to the last person alphabetically by last name - not what I need.
I know you can use SELECT Max("Contact ID") FROM "Contacts", but how do I assign what is returned by this to a global variable I can use in VBA procedures?
I want to determine the max value of an autonumber field, b/c this is an easy way to access the last created record in a table. I can't use DoCmd.GoToRecord , , Last,
because I have a sort active on my recordset, and that navigates to the last person alphabetically by last name - not what I need.
I know you can use SELECT Max("Contact ID") FROM "Contacts", but how do I assign what is returned by this to a global variable I can use in VBA procedures?