Creating a field based on 2 characters from Field 1 and an auto nu

M

MsReece

I am trying to create a field based on the first two letters of one field and
then having 5 random numbers (example: db35751)

Can this be done? If so, please assist. Please note, I am very new and I
am not a whiz at VB.
 
J

John Vinson

I am trying to create a field based on the first two letters of one field and
then having 5 random numbers (example: db35751)

Can this be done? If so, please assist. Please note, I am very new and I
am not a whiz at VB.

You certainly cannot do it using an Autonumber: a random autonumber is
in the range -2^31 to +2^31-1, some two billion either way.

This kind of "composite" key is generally considered A Bad Idea.
Storing information redundantly (the first two letters) is a problem;
storing two disparate chunks of information in the same field is an
even worse idea; constructing an artificial primary key is rarely
beneficial either, since you must test for duplicates anyway. Could
you explain why you feel that this field is necessary?

John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top