Keeping Tracking of who's adding new data..

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

Hello All,
I have a huge database with a lot of users...I have input a procedure
that i got from online to figure out which network user is loging in and
using the form...is there a way i can create another column in my table to
capture each time this user added a record or last edited a record? Thanks
and if you need the procedure than I can paste it on here. Thanks again.
 
Paul,
On my website, I have a sample A97 and A2003 file called Record Statistics, that
demonstrates how to know the Date of Creation (DOC) od a record, and the Date Of Last Edit
(DOLE).
You could add a field to your table called LEU (Last Edit User) that works just like my
DOLE, but capturing the [CurrentUser] system variable.
LEU = [CurrentUser]

--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."
 
Hi Al Campagna,
Thanks a lot! your code is really easy to understand and use.

Everything works fine, the DOC and DOLE. But when I do the
=[CurrentUser], it doesn't give me the network logon, but only the Admin
logon. So I'll trying to use the logon code I grabbed from some other
website and let you know the results, or maybe even ask you for more help if
it doesn't work. Thanks again.

Paul.


Al Campagna said:
Paul,
On my website, I have a sample A97 and A2003 file called Record
Statistics, that demonstrates how to know the Date of Creation (DOC) od a
record, and the Date Of Last Edit (DOLE).
You could add a field to your table called LEU (Last Edit User) that
works just like my DOLE, but capturing the [CurrentUser] system variable.
LEU = [CurrentUser]

--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."

Paul said:
Hello All,
I have a huge database with a lot of users...I have input a procedure
that i got from online to figure out which network user is loging in and
using the form...is there a way i can create another column in my table
to capture each time this user added a record or last edited a record?
Thanks and if you need the procedure than I can paste it on here. Thanks
again.
 
Paul,
You'll be using an API call to the operating system for that value.
Try this...
http://www.mvps.org/access/api/api0008.htm

--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."

Paul said:
Hi Al Campagna,
Thanks a lot! your code is really easy to understand and use.

Everything works fine, the DOC and DOLE. But when I do the =[CurrentUser], it
doesn't give me the network logon, but only the Admin logon. So I'll trying to use the
logon code I grabbed from some other website and let you know the results, or maybe even
ask you for more help if it doesn't work. Thanks again.

Paul.


Al Campagna said:
Paul,
On my website, I have a sample A97 and A2003 file called Record Statistics, that
demonstrates how to know the Date of Creation (DOC) od a record, and the Date Of Last
Edit (DOLE).
You could add a field to your table called LEU (Last Edit User) that works just like
my DOLE, but capturing the [CurrentUser] system variable.
LEU = [CurrentUser]

--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."

Paul said:
Hello All,
I have a huge database with a lot of users...I have input a procedure that i got
from online to figure out which network user is loging in and using the form...is
there a way i can create another column in my table to capture each time this user
added a record or last edited a record? Thanks and if you need the procedure than I
can paste it on here. Thanks again.
 
Hi Al Campagna,
Thanks for the help again. Everything works so far so good regarding
the previous questions I have. So here's what I am able to do: Capturing
the DOC, DOLE, and LUE. But I have one more problem that i've been trying
all day but no luck. I want my database to allow the user who added a
record be able to edit that record but no one else. But in viewing mode,
everyone can view all records. So I'm taking this one step at a time. I'm
currently working on only the user who added the record be allowed to
modified that record. So my Record form is based on a query. And this what
I have so far:

Name
Address
DOC
DOLE
LUE
TempLUE = temp value of fOSUserName()

and I want when my form opens, the query would only select records that the
LUE = TempLUE. TempLUE is a temp value that's copied from fOSUserName.
But i'm having the problem of getting my form to run this query when it
opens.
Thanks.
Paul.

Al Campagna said:
Paul,
You'll be using an API call to the operating system for that value.
Try this...
http://www.mvps.org/access/api/api0008.htm

--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."

Paul said:
Hi Al Campagna,
Thanks a lot! your code is really easy to understand and use.

Everything works fine, the DOC and DOLE. But when I do the
=[CurrentUser], it doesn't give me the network logon, but only the Admin
logon. So I'll trying to use the logon code I grabbed from some other
website and let you know the results, or maybe even ask you for more help
if it doesn't work. Thanks again.

Paul.


Al Campagna said:
Paul,
On my website, I have a sample A97 and A2003 file called Record
Statistics, that demonstrates how to know the Date of Creation (DOC) od
a record, and the Date Of Last Edit (DOLE).
You could add a field to your table called LEU (Last Edit User) that
works just like my DOLE, but capturing the [CurrentUser] system
variable.
LEU = [CurrentUser]

--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."

Hello All,
I have a huge database with a lot of users...I have input a procedure
that i got from online to figure out which network user is loging in
and using the form...is there a way i can create another column in my
table to capture each time this user added a record or last edited a
record? Thanks and if you need the procedure than I can paste it on
here. Thanks again.
 
Paul,
Well, the LUE is really meant, like DOLE, to change each time someone else edits an
existing record. So, perhaps a name like RC (record creator) would be more appropriate,
and... like DOC, the value is set at creation time, and never changes.
You should be able to use your form query to set the RC criteria to...
=[CurrentUser]
That should create a recordset for that CurrentUser of only records with RC=
CurrentUser.

Probably you'll need a separate form for "new" records, since new records have no RC at
query time, no one could enter a new record. That could just be an exact copy of your
editing form, but with no RC criteria, and the form's DataEntry set to Yes.

Not sure what you're doing with the TempLue. I wouldn't think that would be needed...

--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."



Paul said:
Hi Al Campagna,
Thanks for the help again. Everything works so far so good regarding the previous
questions I have. So here's what I am able to do: Capturing the DOC, DOLE, and LUE.
But I have one more problem that i've been trying all day but no luck. I want my
database to allow the user who added a record be able to edit that record but no one
else. But in viewing mode, everyone can view all records. So I'm taking this one step
at a time. I'm currently working on only the user who added the record be allowed to
modified that record. So my Record form is based on a query. And this what I have so
far:

Name
Address
DOC
DOLE
LUE
TempLUE = temp value of fOSUserName()

and I want when my form opens, the query would only select records that the LUE =
TempLUE. TempLUE is a temp value that's copied from fOSUserName.
But i'm having the problem of getting my form to run this query when it opens.
Thanks.
Paul.

Al Campagna said:
Paul,
You'll be using an API call to the operating system for that value.
Try this...
http://www.mvps.org/access/api/api0008.htm

--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."

Paul said:
Hi Al Campagna,
Thanks a lot! your code is really easy to understand and use.

Everything works fine, the DOC and DOLE. But when I do the =[CurrentUser], it
doesn't give me the network logon, but only the Admin logon. So I'll trying to use
the logon code I grabbed from some other website and let you know the results, or
maybe even ask you for more help if it doesn't work. Thanks again.

Paul.


Paul,
On my website, I have a sample A97 and A2003 file called Record Statistics, that
demonstrates how to know the Date of Creation (DOC) od a record, and the Date Of Last
Edit (DOLE).
You could add a field to your table called LEU (Last Edit User) that works just
like my DOLE, but capturing the [CurrentUser] system variable.
LEU = [CurrentUser]

--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."

Hello All,
I have a huge database with a lot of users...I have input a procedure that i got
from online to figure out which network user is loging in and using the form...is
there a way i can create another column in my table to capture each time this user
added a record or last edited a record? Thanks and if you need the procedure than I
can paste it on here. Thanks again.
 
Hi Al Campagna,
Thanks for your fast respond but I'm a little confused. But I took what
you said and created two buttons, one for viewing only, which everyone can
view, another one is for add/edit, providing that their user name is already
in my user name table to allow them to click on this button. The View only
is easy, I just create a Macro with the view option. And I created another
Macro to open the form in Add mode, but no edit mode. And right now
everyone can click on this add/edit mode. So I'm trying to make this
database so that only the user who added a record can edit that record but
no one else. And also only a limited number of users are allowed to add
records. Thanks again.
Paul.
Al Campagna said:
Paul,
Well, the LUE is really meant, like DOLE, to change each time someone
else edits an existing record. So, perhaps a name like RC (record
creator) would be more appropriate, and... like DOC, the value is set at
creation time, and never changes.
You should be able to use your form query to set the RC criteria to...
=[CurrentUser]
That should create a recordset for that CurrentUser of only records with
RC= CurrentUser.

Probably you'll need a separate form for "new" records, since new
records have no RC at query time, no one could enter a new record. That
could just be an exact copy of your editing form, but with no RC criteria,
and the form's DataEntry set to Yes.

Not sure what you're doing with the TempLue. I wouldn't think that
would be needed...

--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."



Paul said:
Hi Al Campagna,
Thanks for the help again. Everything works so far so good regarding
the previous questions I have. So here's what I am able to do:
Capturing the DOC, DOLE, and LUE. But I have one more problem that i've
been trying all day but no luck. I want my database to allow the user
who added a record be able to edit that record but no one else. But in
viewing mode, everyone can view all records. So I'm taking this one step
at a time. I'm currently working on only the user who added the record
be allowed to modified that record. So my Record form is based on a
query. And this what I have so far:

Name
Address
DOC
DOLE
LUE
TempLUE = temp value of fOSUserName()

and I want when my form opens, the query would only select records that
the LUE = TempLUE. TempLUE is a temp value that's copied from
fOSUserName.
But i'm having the problem of getting my form to run this query when it
opens.
Thanks.
Paul.

Al Campagna said:
Paul,
You'll be using an API call to the operating system for that value.
Try this...
http://www.mvps.org/access/api/api0008.htm

--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."

Hi Al Campagna,
Thanks a lot! your code is really easy to understand and use.

Everything works fine, the DOC and DOLE. But when I do the
=[CurrentUser], it doesn't give me the network logon, but only the
Admin logon. So I'll trying to use the logon code I grabbed from some
other website and let you know the results, or maybe even ask you for
more help if it doesn't work. Thanks again.

Paul.


Paul,
On my website, I have a sample A97 and A2003 file called Record
Statistics, that demonstrates how to know the Date of Creation (DOC)
od a record, and the Date Of Last Edit (DOLE).
You could add a field to your table called LEU (Last Edit User) that
works just like my DOLE, but capturing the [CurrentUser] system
variable.
LEU = [CurrentUser]

--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."

Hello All,
I have a huge database with a lot of users...I have input a
procedure that i got from online to figure out which network user is
loging in and using the form...is there a way i can create another
column in my table to capture each time this user added a record or
last edited a record? Thanks and if you need the procedure than I can
paste it on here. Thanks again.
 
Paul,
First, macros are extremely limited. You'll probably ned to code up the solution.
I can only suggest that if you have a menu form that allows users to either select View
or Select AddNew, or select Edit, that that would be the best place for your code.
In the Menu form's OnCurrent event you'll need to determine who is using the form, and
if they are not in a table somewhere that indicates they have edit capabilities... the
Edit button would be disabled. Conversely if they have Edit capabilities the Edit button
would be enabled.
Use the Dlookup function to determine what user can do what function.

--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."



Paul said:
Hi Al Campagna,
Thanks for your fast respond but I'm a little confused. But I took what you said and
created two buttons, one for viewing only, which everyone can view, another one is for
add/edit, providing that their user name is already in my user name table to allow them
to click on this button. The View only is easy, I just create a Macro with the view
option. And I created another Macro to open the form in Add mode, but no edit mode.
And right now everyone can click on this add/edit mode. So I'm trying to make this
database so that only the user who added a record can edit that record but no one else.
And also only a limited number of users are allowed to add records. Thanks again.
Paul.
Al Campagna said:
Paul,
Well, the LUE is really meant, like DOLE, to change each time someone else edits an
existing record. So, perhaps a name like RC (record creator) would be more
appropriate, and... like DOC, the value is set at creation time, and never changes.
You should be able to use your form query to set the RC criteria to...
=[CurrentUser]
That should create a recordset for that CurrentUser of only records with RC=
CurrentUser.

Probably you'll need a separate form for "new" records, since new records have no RC
at query time, no one could enter a new record. That could just be an exact copy of
your editing form, but with no RC criteria, and the form's DataEntry set to Yes.

Not sure what you're doing with the TempLue. I wouldn't think that would be
needed...

--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."



Paul said:
Hi Al Campagna,
Thanks for the help again. Everything works so far so good regarding the previous
questions I have. So here's what I am able to do: Capturing the DOC, DOLE, and LUE.
But I have one more problem that i've been trying all day but no luck. I want my
database to allow the user who added a record be able to edit that record but no one
else. But in viewing mode, everyone can view all records. So I'm taking this one
step at a time. I'm currently working on only the user who added the record be
allowed to modified that record. So my Record form is based on a query. And this
what I have so far:

Name
Address
DOC
DOLE
LUE
TempLUE = temp value of fOSUserName()

and I want when my form opens, the query would only select records that the LUE =
TempLUE. TempLUE is a temp value that's copied from fOSUserName.
But i'm having the problem of getting my form to run this query when it opens.
Thanks.
Paul.

Paul,
You'll be using an API call to the operating system for that value.
Try this...
http://www.mvps.org/access/api/api0008.htm

--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."

Hi Al Campagna,
Thanks a lot! your code is really easy to understand and use.

Everything works fine, the DOC and DOLE. But when I do the =[CurrentUser], it
doesn't give me the network logon, but only the Admin logon. So I'll trying to use
the logon code I grabbed from some other website and let you know the results, or
maybe even ask you for more help if it doesn't work. Thanks again.

Paul.


Paul,
On my website, I have a sample A97 and A2003 file called Record Statistics, that
demonstrates how to know the Date of Creation (DOC) od a record, and the Date Of
Last Edit (DOLE).
You could add a field to your table called LEU (Last Edit User) that works just
like my DOLE, but capturing the [CurrentUser] system variable.
LEU = [CurrentUser]

--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."

Hello All,
I have a huge database with a lot of users...I have input a procedure that i got
from online to figure out which network user is loging in and using the form...is
there a way i can create another column in my table to capture each time this user
added a record or last edited a record? Thanks and if you need the procedure than
I can paste it on here. Thanks again.
 
Paul,
Might I suggest something like a "permission rating" to indicate what functions each
user has access to.
1 = Edit/View/Add
2 = View/Add
3 = ViewOnly

UserName Permission
BobG 1
AnnT 2
MaryH 1 etc...

Don't take me "literally" with these sample values, but think about the concept...
--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."


Paul said:
Hi Al Campagna,
Thanks for your fast respond but I'm a little confused. But I took what you said and
created two buttons, one for viewing only, which everyone can view, another one is for
add/edit, providing that their user name is already in my user name table to allow them
to click on this button. The View only is easy, I just create a Macro with the view
option. And I created another Macro to open the form in Add mode, but no edit mode.
And right now everyone can click on this add/edit mode. So I'm trying to make this
database so that only the user who added a record can edit that record but no one else.
And also only a limited number of users are allowed to add records. Thanks again.
Paul.
Al Campagna said:
Paul,
Well, the LUE is really meant, like DOLE, to change each time someone else edits an
existing record. So, perhaps a name like RC (record creator) would be more
appropriate, and... like DOC, the value is set at creation time, and never changes.
You should be able to use your form query to set the RC criteria to...
=[CurrentUser]
That should create a recordset for that CurrentUser of only records with RC=
CurrentUser.

Probably you'll need a separate form for "new" records, since new records have no RC
at query time, no one could enter a new record. That could just be an exact copy of
your editing form, but with no RC criteria, and the form's DataEntry set to Yes.

Not sure what you're doing with the TempLue. I wouldn't think that would be
needed...

--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."



Paul said:
Hi Al Campagna,
Thanks for the help again. Everything works so far so good regarding the previous
questions I have. So here's what I am able to do: Capturing the DOC, DOLE, and LUE.
But I have one more problem that i've been trying all day but no luck. I want my
database to allow the user who added a record be able to edit that record but no one
else. But in viewing mode, everyone can view all records. So I'm taking this one
step at a time. I'm currently working on only the user who added the record be
allowed to modified that record. So my Record form is based on a query. And this
what I have so far:

Name
Address
DOC
DOLE
LUE
TempLUE = temp value of fOSUserName()

and I want when my form opens, the query would only select records that the LUE =
TempLUE. TempLUE is a temp value that's copied from fOSUserName.
But i'm having the problem of getting my form to run this query when it opens.
Thanks.
Paul.

Paul,
You'll be using an API call to the operating system for that value.
Try this...
http://www.mvps.org/access/api/api0008.htm

--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."

Hi Al Campagna,
Thanks a lot! your code is really easy to understand and use.

Everything works fine, the DOC and DOLE. But when I do the =[CurrentUser], it
doesn't give me the network logon, but only the Admin logon. So I'll trying to use
the logon code I grabbed from some other website and let you know the results, or
maybe even ask you for more help if it doesn't work. Thanks again.

Paul.


Paul,
On my website, I have a sample A97 and A2003 file called Record Statistics, that
demonstrates how to know the Date of Creation (DOC) od a record, and the Date Of
Last Edit (DOLE).
You could add a field to your table called LEU (Last Edit User) that works just
like my DOLE, but capturing the [CurrentUser] system variable.
LEU = [CurrentUser]

--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."

Hello All,
I have a huge database with a lot of users...I have input a procedure that i got
from online to figure out which network user is loging in and using the form...is
there a way i can create another column in my table to capture each time this user
added a record or last edited a record? Thanks and if you need the procedure than
I can paste it on here. Thanks again.
 
Thanks Al Campagna,
I'm gonna do that and let you know the results.
Paul
Al Campagna said:
Paul,
Might I suggest something like a "permission rating" to indicate what functions each
user has access to.
1 = Edit/View/Add
2 = View/Add
3 = ViewOnly

UserName Permission
BobG 1
AnnT 2
MaryH 1 etc...

Don't take me "literally" with these sample values, but think about the concept...
--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."


Paul said:
Hi Al Campagna,
Thanks for your fast respond but I'm a little confused. But I took what you said and
created two buttons, one for viewing only, which everyone can view, another one is for
add/edit, providing that their user name is already in my user name table to allow them
to click on this button. The View only is easy, I just create a Macro with the view
option. And I created another Macro to open the form in Add mode, but no edit mode.
And right now everyone can click on this add/edit mode. So I'm trying to make this
database so that only the user who added a record can edit that record but no one else.
And also only a limited number of users are allowed to add records. Thanks again.
Paul.
Al Campagna said:
Paul,
Well, the LUE is really meant, like DOLE, to change each time someone else edits an
existing record. So, perhaps a name like RC (record creator) would be more
appropriate, and... like DOC, the value is set at creation time, and never changes.
You should be able to use your form query to set the RC criteria to...
=[CurrentUser]
That should create a recordset for that CurrentUser of only records with RC=
CurrentUser.

Probably you'll need a separate form for "new" records, since new records have no RC
at query time, no one could enter a new record. That could just be an exact copy of
your editing form, but with no RC criteria, and the form's DataEntry set to Yes.

Not sure what you're doing with the TempLue. I wouldn't think that would be
needed...

--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."



Hi Al Campagna,
Thanks for the help again. Everything works so far so good regarding the previous
questions I have. So here's what I am able to do: Capturing the DOC, DOLE, and LUE.
But I have one more problem that i've been trying all day but no luck. I want my
database to allow the user who added a record be able to edit that record but no one
else. But in viewing mode, everyone can view all records. So I'm taking this one
step at a time. I'm currently working on only the user who added the record be
allowed to modified that record. So my Record form is based on a query. And this
what I have so far:

Name
Address
DOC
DOLE
LUE
TempLUE = temp value of fOSUserName()

and I want when my form opens, the query would only select records that the LUE =
TempLUE. TempLUE is a temp value that's copied from fOSUserName.
But i'm having the problem of getting my form to run this query when it opens.
Thanks.
Paul.

Paul,
You'll be using an API call to the operating system for that value.
Try this...
http://www.mvps.org/access/api/api0008.htm

--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."

Hi Al Campagna,
Thanks a lot! your code is really easy to understand and use.

Everything works fine, the DOC and DOLE. But when I do the =[CurrentUser], it
doesn't give me the network logon, but only the Admin logon. So I'll trying to use
the logon code I grabbed from some other website and let you know the results, or
maybe even ask you for more help if it doesn't work. Thanks again.

Paul.


Paul,
On my website, I have a sample A97 and A2003 file called Record Statistics, that
demonstrates how to know the Date of Creation (DOC) od a record, and the Date Of
Last Edit (DOLE).
You could add a field to your table called LEU (Last Edit User) that works just
like my DOLE, but capturing the [CurrentUser] system variable.
LEU = [CurrentUser]

--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."

Hello All,
I have a huge database with a lot of users...I have input a procedure that i got
from online to figure out which network user is loging in and using the form...is
there a way i can create another column in my table to capture each time this user
added a record or last edited a record? Thanks and if you need the procedure than
I can paste it on here. Thanks again.
 
Thanks Al Campagna,
I'm gonna do that and let you know the results.
Paul
Al Campagna said:
Paul,
Might I suggest something like a "permission rating" to indicate what functions each
user has access to.
1 = Edit/View/Add
2 = View/Add
3 = ViewOnly

UserName Permission
BobG 1
AnnT 2
MaryH 1 etc...

Don't take me "literally" with these sample values, but think about the concept...
--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."


Paul said:
Hi Al Campagna,
Thanks for your fast respond but I'm a little confused. But I took what you said and
created two buttons, one for viewing only, which everyone can view, another one is for
add/edit, providing that their user name is already in my user name table to allow them
to click on this button. The View only is easy, I just create a Macro with the view
option. And I created another Macro to open the form in Add mode, but no edit mode.
And right now everyone can click on this add/edit mode. So I'm trying to make this
database so that only the user who added a record can edit that record but no one else.
And also only a limited number of users are allowed to add records. Thanks again.
Paul.
Al Campagna said:
Paul,
Well, the LUE is really meant, like DOLE, to change each time someone else edits an
existing record. So, perhaps a name like RC (record creator) would be more
appropriate, and... like DOC, the value is set at creation time, and never changes.
You should be able to use your form query to set the RC criteria to...
=[CurrentUser]
That should create a recordset for that CurrentUser of only records with RC=
CurrentUser.

Probably you'll need a separate form for "new" records, since new records have no RC
at query time, no one could enter a new record. That could just be an exact copy of
your editing form, but with no RC criteria, and the form's DataEntry set to Yes.

Not sure what you're doing with the TempLue. I wouldn't think that would be
needed...

--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."



Hi Al Campagna,
Thanks for the help again. Everything works so far so good regarding the previous
questions I have. So here's what I am able to do: Capturing the DOC, DOLE, and LUE.
But I have one more problem that i've been trying all day but no luck. I want my
database to allow the user who added a record be able to edit that record but no one
else. But in viewing mode, everyone can view all records. So I'm taking this one
step at a time. I'm currently working on only the user who added the record be
allowed to modified that record. So my Record form is based on a query. And this
what I have so far:

Name
Address
DOC
DOLE
LUE
TempLUE = temp value of fOSUserName()

and I want when my form opens, the query would only select records that the LUE =
TempLUE. TempLUE is a temp value that's copied from fOSUserName.
But i'm having the problem of getting my form to run this query when it opens.
Thanks.
Paul.

Paul,
You'll be using an API call to the operating system for that value.
Try this...
http://www.mvps.org/access/api/api0008.htm

--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."

Hi Al Campagna,
Thanks a lot! your code is really easy to understand and use.

Everything works fine, the DOC and DOLE. But when I do the =[CurrentUser], it
doesn't give me the network logon, but only the Admin logon. So I'll trying to use
the logon code I grabbed from some other website and let you know the results, or
maybe even ask you for more help if it doesn't work. Thanks again.

Paul.


Paul,
On my website, I have a sample A97 and A2003 file called Record Statistics, that
demonstrates how to know the Date of Creation (DOC) od a record, and the Date Of
Last Edit (DOLE).
You could add a field to your table called LEU (Last Edit User) that works just
like my DOLE, but capturing the [CurrentUser] system variable.
LEU = [CurrentUser]

--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."

Hello All,
I have a huge database with a lot of users...I have input a procedure that i got
from online to figure out which network user is loging in and using the form...is
there a way i can create another column in my table to capture each time this user
added a record or last edited a record? Thanks and if you need the procedure than
I can paste it on here. Thanks again.
 
Back
Top