David Anderson
Registered User.
- Local time
- Today, 14:52
- Joined
- Nov 18, 2007
- Messages
- 84
I am returning to Access 2003 VBA programming (with DAO rather than ADO) after a gap of a year and my rusty brain needs some assistance.
I am trying to write some code for a form that will add a new record to a table. For complicated reasons I won't bore you with, the Primary Key of this table is a 5-character text field of the format 'P####', where #### is a number with leading zeros derived from an Autonumber field in the same table. For example, if the autonumber value is 345, then the PK would be set to 'P0345'.
My problem is that I need to find out what the next autonumber value will be before I can create the PK and save the new record.
I am certain that there is a very simple answer to this problem, but it escapes me for the moment and I would appreciate some guidance.
David
I am trying to write some code for a form that will add a new record to a table. For complicated reasons I won't bore you with, the Primary Key of this table is a 5-character text field of the format 'P####', where #### is a number with leading zeros derived from an Autonumber field in the same table. For example, if the autonumber value is 345, then the PK would be set to 'P0345'.
My problem is that I need to find out what the next autonumber value will be before I can create the PK and save the new record.
I am certain that there is a very simple answer to this problem, but it escapes me for the moment and I would appreciate some guidance.
David