On 17 Dec 2005 14:39:49 -0800, "francophone77"
<fr***********@hotmail.com> wrote:
I'm trying to create a database that has the following features but
don't know the best way to go about it.
1. When a user opens the database, I'd like that user to enter a 3
letter code to identify the user.
2. That 3 letter code would then be used as the first 3 characters in
the primary key field.
ie. User ID is FSJ. Any record created would then have the primary key
as FSJ***.
The reason for this is I'd like to have a database on the server which
holds all the records. Then when several users takes that database on
the road (ie. laptop), records they create would all have different
primary keys and through replication, these new records could be added
to the database on the server.
For your scheme to work, you need to be dealing simply with adding
records. Are you sure you aren't going to have any of the
disconnected users EDITING any of the existing information? If so,
then a replication scheme based solely on adding records will not
function very well.
But, for now, let's assume that all you want to do is ensure that
newly created information finds its way to the main database.
Primary keys (actually, any key, whether primary or not) can be a
combination of fields. I'm presuming that you are thinking that the
initials of which you speak will be prepended to an autonumber field.
There is no need to prepend them. Just define your primary key as the
combination of the autonumber field and a field that you use for
storing the initials of the record creator.
The only issue left is what happens if there end up being two records
with the same number in the field that you are using for your
autonumber. In a word: nothing. Just make sure that the autonumber
field isn't itself an indexed field requiring unique values and Access
will allow you to append the data from your satellite databases
without a problem.
mike