Access 2000 primary key + copy

C

Carsten, Denmark

Hi

I'm building a database for my firm, where the client nr is the main
phonenr, and i have to fields for phonenr's too, where the first one also is
the main number used as client nr, wich is primary key..

The thing i need to do is to check both phonenr records against primary key,
to be sure when someone puts a new client in the database, that i don't get
the same client twice, just with two different phonenr, how can i do this ?

The other thing is, when adding a new client, i need the database itself to
copy the client nr (main phone nr) to the "phone 1" field, so that i don't
need to put it in twice :) ?

And a bonus question: When making a standalone database, is it possible to,
when adding several clients, to have a form popup, where it is possible to
put in standard values for selected fields, before adding clients, ex. from
same area code ?

Best regards and thanks
Carsten, Denmark
 
A

Arvin Meyer MVP

It is usually poor database design to have a key be equal to, or part of,
any other field in a table. That said it is absolutely unnecessary to have
duplication of anything within a table. Except in rare instances, like state
or country abbreviations, I never use a key which is manually entered. It is
way too easy to have a user make a mistake. Further, in the case of phone
numbers each character is doubled (Unicode uses 2 bytes for each character)
making a 20 (or more) byte key as opposed to a 4 byte autonumber key.

Duplicates may be avoided by using a lookup (like DLookup or a recordset
lookup) in the BeforeUpdate event of the textbox housing the key field.

For the bonus: Have a look at the DefaultValue property of a field and/or a
control in a form.
 
C

Carsten, Denmark

Hi Arvin

Thanks for your reply

I'll, consider your suggestions :)

And have a look at DLookup :)

Thanks
Carsten, Denmark
 

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