Automatically Naming New Records accoridng to set criteria

Rob Marr

New member
Local time
Today, 17:19
Joined
May 28, 2009
Messages
9
Hi,

My database holds information on various patients. A copy of it will be issued to a number of different organisations to record patient information before returning an anonymised version of the data to a central point.

To keep track of this data locally and centrally I need each new record to autocomplete with a new ID. The field is called PT_ID and the table it sits in is tblPatientInformation. This field is also the field that links several tables.

I want to set the field up with the following format: ABC1, ABC2, ABC3 and so on. The letters will change according to the service.

Can anyone help please?

Thank you,

Rob
 
1. Yes, it's possible, but you will need to implement some VBA code to do it - this sort of question comes up on the board almost daily - try a search on 'custom autonumber'

2. DON'T use a meaningful ID like this to relate to records in other tables - add an ordinary autonumber ID to the main table (may be completely hidden from the user) and use this to link to your other tables.
If you use a meaningful field as a key, it's highly likely to cause heartache later when the meaning or structure of the field has to undergo changes.
 

Users who are viewing this thread

Back
Top Bottom