Custom counter

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using Office 2003 (sp3) on Windows XP;

I would like to create an ID that prefixes some text at the beginning of the
value, so for example the unique ID might look like: bk1; bk2; etc.

I came up with using an autonumber field along side a second column that
prepends the text needed so in the table it looks like:

1 bk1
2 bk2
3 bk3
etc...

Then I saw MS article Q210194 that would essentially do the same thing, but
perhaps a little cleaner?

Which of these two methods is preferable? Has anyone got any other ideas on
how to do this? Is there a best practice for doing this in MS-Access?

I'm fairly up to speed, but would appreciate any examples in code or
otherwise.

Thanks much in advance for any suggestions or guidance.
 
Do you need the actual data in the field (be aware that storing two "pieces"
of data in one field is not good db design)?

Would it be enough to have the display of the field include a "constant" =
"bk" (or might there be other prefixes)?

What about using two fields to hold the prefix and the sequence number, and
using a query to "join" them for display in forms and reports? (This is the
preferred/recommended method.)

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Back
Top