Updating Front-end files

G

Guest

I have 5 front-end files for each data entry user, their manager needs to
know who is entering what.
Reports and forms are based on queries that contain the [Staff Code] for
each user. For example, "USER1" has [Staff Code] = user1 in all his queries.
I copied this file for "USER2" and set his Staff Code on his queries; same
thing for rest of users. I have done this so they cannot see other users'
data, only their own.
Everyhting works just fine, my problem is that when I have to update the
front-end files I have to do the same thing five times, once per user.
Any suggestions on how to streamline this process? Any help will be greatly
appreciated. :)
 
R

Rick Brandt

Ricoy-Chicago said:
I have 5 front-end files for each data entry user, their manager
needs to know who is entering what.
Reports and forms are based on queries that contain the [Staff Code]
for each user. For example, "USER1" has [Staff Code] = user1 in all
his queries. I copied this file for "USER2" and set his Staff Code on
his queries; same thing for rest of users. I have done this so they
cannot see other users' data, only their own.
Everyhting works just fine, my problem is that when I have to update
the front-end files I have to do the same thing five times, once per
user.
Any suggestions on how to streamline this process? Any help will be
greatly appreciated. :)

Open a small form at startup that asks them for their Staff Code and have an
[OK] button that hides that form. Then your queries can all be changed
to...

[Staff Code] = Forms!FormName!ControlName

You could even use the code at the link below to retrieve their Network
UserName and with a translation table you could recognize their Staff Code
value without asking them.

http://www.mvps.org/access/api/api0008.htm
 
G

Guest

I am sorry if I am a little slow today (it's Friday). On your Coding:

[Staff Code] = Forms!FormName!ControlName

Am I assuming correctly that ControlName is the name of a text box?

Staff knows everyone else's [Staff Code]. You suggestion will alow them to
enter someone else's staff code to edit/view somebody else's data. This is a
"no-no".

Can I have some coding instead that asks for a "password" that will set
their [Staff Code]? I know that this password has nothing to do with the one
that opens the file.

Thank you for your help.

Rick Brandt said:
Ricoy-Chicago said:
I have 5 front-end files for each data entry user, their manager
needs to know who is entering what.
Reports and forms are based on queries that contain the [Staff Code]
for each user. For example, "USER1" has [Staff Code] = user1 in all
his queries. I copied this file for "USER2" and set his Staff Code on
his queries; same thing for rest of users. I have done this so they
cannot see other users' data, only their own.
Everyhting works just fine, my problem is that when I have to update
the front-end files I have to do the same thing five times, once per
user.
Any suggestions on how to streamline this process? Any help will be
greatly appreciated. :)

Open a small form at startup that asks them for their Staff Code and have an
[OK] button that hides that form. Then your queries can all be changed
to...

[Staff Code] = Forms!FormName!ControlName

You could even use the code at the link below to retrieve their Network
UserName and with a translation table you could recognize their Staff Code
value without asking them.

http://www.mvps.org/access/api/api0008.htm
 
R

Rick Brandt

Ricoy-Chicago said:
I am sorry if I am a little slow today (it's Friday). On your Coding:

[Staff Code] = Forms!FormName!ControlName

Am I assuming correctly that ControlName is the name of a text box?
Yes

Staff knows everyone else's [Staff Code]. You suggestion will alow
them to enter someone else's staff code to edit/view somebody else's
data. This is a "no-no".

Can I have some coding instead that asks for a "password" that will
set their [Staff Code]? I know that this password has nothing to do
with the one that opens the file.

I would suggest you use the code that I had a link to in my previous post
(and again below) to retrieve the user's Network user name and then fill in
the Staff Code automatically. Wouldn't that address your security concern?
Then you wouldn't have to bother with passwords and password validation
which is hard to do securely in an Access app anyway.

http://www.mvps.org/access/api/api0008.htm
 
G

Guest

Thank you Rick.
I copied the coding from the link. I think I got it. If not, I will post my
Q's on Monday, have a nice weekend.

Rick Brandt said:
Ricoy-Chicago said:
I am sorry if I am a little slow today (it's Friday). On your Coding:

[Staff Code] = Forms!FormName!ControlName

Am I assuming correctly that ControlName is the name of a text box?
Yes

Staff knows everyone else's [Staff Code]. You suggestion will alow
them to enter someone else's staff code to edit/view somebody else's
data. This is a "no-no".

Can I have some coding instead that asks for a "password" that will
set their [Staff Code]? I know that this password has nothing to do
with the one that opens the file.

I would suggest you use the code that I had a link to in my previous post
(and again below) to retrieve the user's Network user name and then fill in
the Staff Code automatically. Wouldn't that address your security concern?
Then you wouldn't have to bother with passwords and password validation
which is hard to do securely in an Access app anyway.

http://www.mvps.org/access/api/api0008.htm
 
G

Guest

I'm back..

I copy-paste the coding to a new module, I save the module under the name
"fOSUserName".

I created a form with a "signin" button to try to get the UserName. This is
my code:

Private Sub cmdSignIn_Click()
On Error GoTo Err_cmdSignIn_Click

Dim Temp As String
Dim mdl As Module

Set mdl = Modules!fOSUserName()
Temp = mdl
txtUserName = Temp

Exit_cmdSignIn_Click:
Exit Sub

Err_cmdSignIn_Click:
MsgBox Err.Description
Resume Exit_cmdSignIn_Click

End Sub

When I click on the command button I get txtUserName = "fOSUserName"

I get the name of the module not the actual UserName, What am I missing?

Thank you for all your help!

Ricoy-Chicago said:
Thank you Rick.
I copied the coding from the link. I think I got it. If not, I will post my
Q's on Monday, have a nice weekend.

Rick Brandt said:
Ricoy-Chicago said:
I am sorry if I am a little slow today (it's Friday). On your Coding:

[Staff Code] = Forms!FormName!ControlName

Am I assuming correctly that ControlName is the name of a text box?
Yes

Staff knows everyone else's [Staff Code]. You suggestion will alow
them to enter someone else's staff code to edit/view somebody else's
data. This is a "no-no".

Can I have some coding instead that asks for a "password" that will
set their [Staff Code]? I know that this password has nothing to do
with the one that opens the file.

I would suggest you use the code that I had a link to in my previous post
(and again below) to retrieve the user's Network user name and then fill in
the Staff Code automatically. Wouldn't that address your security concern?
Then you wouldn't have to bother with passwords and password validation
which is hard to do securely in an Access app anyway.

http://www.mvps.org/access/api/api0008.htm
 
G

Guest

I got it! thank you!!!

Ricoy-Chicago said:
I'm back..

I copy-paste the coding to a new module, I save the module under the name
"fOSUserName".

I created a form with a "signin" button to try to get the UserName. This is
my code:

Private Sub cmdSignIn_Click()
On Error GoTo Err_cmdSignIn_Click

Dim Temp As String
Dim mdl As Module

Set mdl = Modules!fOSUserName()
Temp = mdl
txtUserName = Temp

Exit_cmdSignIn_Click:
Exit Sub

Err_cmdSignIn_Click:
MsgBox Err.Description
Resume Exit_cmdSignIn_Click

End Sub

When I click on the command button I get txtUserName = "fOSUserName"

I get the name of the module not the actual UserName, What am I missing?

Thank you for all your help!

Ricoy-Chicago said:
Thank you Rick.
I copied the coding from the link. I think I got it. If not, I will post my
Q's on Monday, have a nice weekend.

Rick Brandt said:
Ricoy-Chicago wrote:
I am sorry if I am a little slow today (it's Friday). On your Coding:

[Staff Code] = Forms!FormName!ControlName

Am I assuming correctly that ControlName is the name of a text box?

Yes

Staff knows everyone else's [Staff Code]. You suggestion will alow
them to enter someone else's staff code to edit/view somebody else's
data. This is a "no-no".

Can I have some coding instead that asks for a "password" that will
set their [Staff Code]? I know that this password has nothing to do
with the one that opens the file.

I would suggest you use the code that I had a link to in my previous post
(and again below) to retrieve the user's Network user name and then fill in
the Staff Code automatically. Wouldn't that address your security concern?
Then you wouldn't have to bother with passwords and password validation
which is hard to do securely in an Access app anyway.

http://www.mvps.org/access/api/api0008.htm
 
L

leo

Ricoy-Chicago said:
Thank you Rick.
I copied the coding from the link. I think I got it. If not, I will post my
Q's on Monday, have a nice weekend.

Rick Brandt said:
Ricoy-Chicago said:
I am sorry if I am a little slow today (it's Friday). On your Coding:

[Staff Code] = Forms!FormName!ControlName

Am I assuming correctly that ControlName is the name of a text box?
Yes

Staff knows everyone else's [Staff Code]. You suggestion will alow
them to enter someone else's staff code to edit/view somebody else's
data. This is a "no-no".

Can I have some coding instead that asks for a "password" that will
set their [Staff Code]? I know that this password has nothing to do
with the one that opens the file.

I would suggest you use the code that I had a link to in my previous post
(and again below) to retrieve the user's Network user name and then fill in
the Staff Code automatically. Wouldn't that address your security concern?
Then you wouldn't have to bother with passwords and password validation
which is hard to do securely in an Access app anyway.

http://www.mvps.org/access/api/api0008.htm
 

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