473,432 Members | 1,676 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,432 software developers and data experts.

Key based on Login entry

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.

TIA

Dec 17 '05 #1
4 1222
francophone77 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.

TIA

If you have security applied to your app, you can use CurrentUser().

You could have a field in the employee file called LoginName. This
field stores the value of the login name. Then when a person logs in,
you can get the info you want from the employee file....like your 3
letter code. You might be better of storing the EmpID instead.

Anyway, that's the approach I'd take. If you want to take your
approach, perhaps call up a form or InputBox() to get the 3 chars and
call that in your main form or an autoexec macro.


Dec 17 '05 #2
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
Dec 18 '05 #3
.... to follow on from salads suggestion.

I would strongly reccomend against including the user identification in a
field with other data as the primary key. It is much easier to store it in
a field on it's own, this makes filtering and sorting by this data much
easier and you can always concatenate it to other data if necessary in order
to display it.

--
Terry Kreft

"salad" <oi*@vinegar.com> wrote in message
news:NF*****************@newsread1.news.pas.earthl ink.net...
francophone77 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.

TIA

If you have security applied to your app, you can use CurrentUser().

You could have a field in the employee file called LoginName. This field
stores the value of the login name. Then when a person logs in, you can
get the info you want from the employee file....like your 3 letter code.
You might be better of storing the EmpID instead.

Anyway, that's the approach I'd take. If you want to take your approach,
perhaps call up a form or InputBox() to get the 3 chars and call that in
your main form or an autoexec macro.

Dec 18 '05 #4
Thanks for the suggestions. The information in the main database will
not be edited, I just need a way to include data entered while users
are on the road with a replication of the main database. I'm going to
try utilizing 2 primary keys as suggested using the initials plus the
autonumber. thanks for your suggestions

Dec 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: jiing | last post by:
<?php $ldapServer="ldap://192.168.1.211"; $ldapPort="389"; $ldapconn=ldap_connect($ldapServer,$ldapPort); $ldaprdn="uid=root, ou=People, dc=aitc, dc=com, dc=tw"; $ldappass="abcd"; ...
6
by: Rich | last post by:
Hello, I need users to access a data entry asp page via a login page. If they bookmark the data entry asp I want to redirect them to the login page (using IIS). Here is what I had in mind: ...
2
by: Charles | last post by:
I was able to do this but for no reason I can think of, now I cannot login to my Oracle Management Server. When Oracle Enterprise Manager starts up and I choose to login to OMS, it throws up a java...
1
by: Christopher | last post by:
We are using forms authentication in our web app and typically query our LDAP Servers by binding to the user node in the LDAP Tree. We usually see the following DN used as the DN for each user.....
1
by: Friends | last post by:
Hi I need to set security for row level but not based on Database user's login. It should be based on the user table login. For the particular user I need to allow only the particular records to...
43
by: davidkoree | last post by:
I mean not about cookie. Does it have something to do with operating system or browser plugin? I appreciate any help.
3
by: gavm360 | last post by:
Hello, I'm making a data entry form that i would like to have display the operators name. So far i have a preceeding "Login" form in which the operator inputs his/her employee number into a...
13
JodiPhillips
by: JodiPhillips | last post by:
G'day, I have a silly and simple problem that I need some guidance with. Due to the way our network is set up, I am unable to use the group permissions for Access and have had to implement log...
3
by: satishknight | last post by:
Hi, Can some one tell me how to change the validation sequence for the code pasted below, actually what I want it when any one enters the wrong login information (already registered users) then it...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.