Randomblink
The Irreverent Reverend
- Local time
- Today, 03:24
- Joined
- Jul 23, 2001
- Messages
- 279
Greetings one and all...
Just a quick question for the masters...
If I am using DoCmd.RunSQL to INSERT a record to a table.
And if that table has a Primary Key with Autonumber.
Is there ANYWAY to INSERT that record AND grab the Autonumber generated?
For instance...
Let's say I have a Customer Table...
and I am running DoCmd.RunSQL to INSERT a new customer.
Let's say I have a field called Customer_ID
THAT Field is the Primary Key / Autonumber
Is there anyway to insert a new customer and then grab the Customer_ID for THAT Customer?
Some command?
rst!Customer_ID right AFTER inserting maybe?
Just a quick question for the masters...
If I am using DoCmd.RunSQL to INSERT a record to a table.
And if that table has a Primary Key with Autonumber.
Is there ANYWAY to INSERT that record AND grab the Autonumber generated?
For instance...
Let's say I have a Customer Table...
and I am running DoCmd.RunSQL to INSERT a new customer.
Let's say I have a field called Customer_ID
THAT Field is the Primary Key / Autonumber
Is there anyway to insert a new customer and then grab the Customer_ID for THAT Customer?
Some command?
rst!Customer_ID right AFTER inserting maybe?