Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / May 2007

Tip: Looking for answers? Try searching our database.

Only the creator can edit record

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
RobUCSD - 29 May 2007 21:15 GMT
I have developed an access application for the medical field (with much help
form this group, Thanks!) I have forms where nurses and doctors are able to
choose from a picklist of brief blurbs, i.e. Patient presents to clinic today
in acute distress. The blurge is then added to a table and is visible and
editable via a form.

What I need to do is make it so that only the creator of the record can edit
the record. To do that I need to record the current user's user name (I'm
using MS Access user level security) and then I need to check if this user
was the creator of the record. If they are the creator then they can edit it,
if not then they cannot edit.

Any help with this would be greatly appreciated. Rob
Klatuu - 29 May 2007 22:03 GMT
First, you need a field in the table that is the record source for the form
so you will know who created the record.  Then create a field on the formI
would name the form control txtCurrentUser and set it to Locked = Yes and
Enabled = No or make it Invisible, whichever suits you best. Set it's Default
Value to =CurrentUser.

Then at the point a user attempts to modify a record, use something like this:
I will use the form's Before Update event as an example:

If CurrentUser <> Me.txtCurrentUser Then
   MsgBox "Only the Creator of this record may change it"
   Cancel = True
End If

Signature

Dave Hargis, Microsoft Access MVP

> I have developed an access application for the medical field (with much help
> form this group, Thanks!) I have forms where nurses and doctors are able to
[quoted text clipped - 9 lines]
>
> Any help with this would be greatly appreciated. Rob
RobUCSD - 29 May 2007 22:23 GMT
Beautiful, Thank You. Rob

> First, you need a field in the table that is the record source for the form
> so you will know who created the record.  Then create a field on the formI
[quoted text clipped - 23 lines]
> >
> > Any help with this would be greatly appreciated. Rob
missinglinq - 29 May 2007 22:37 GMT
You're going to run afoul of JCAHO with this approach, to say nothing of
malpractise lawyers! In hand written notes, a health care provider cannot
remove a written note and then write another, which is essentially what
you're trying to allow them to do. They have to strike thru the old notes
with a single line and initial it, then write another note in it's place! The
only way to emulate this in online notes is to only allow notes to be emended.
The old text has to remain, with the person adding an additional note stating
something like "Correction to note of thus and such day and time."

The general way that I do this is to make the memo field itself always locked.
I mput a button next to it, call it "ADD a Note." Clicking it brings up a
text box for adding notes. The user enters their notes and DoubleClick the
note field. The note gets added to the old text, along with a date/time stamp
and the user username.

If JCAHO or an attorney comes along, you can show that the use has no means
of changing a previously entered note.

I'm 4+ busy right now, but I'll dig around and post some example back here in
a day or two, if you're interested!

Signature

There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

RobUCSD - 29 May 2007 23:09 GMT
Yes, I'm interested. Thanks,
Rob

> You're going to run afoul of JCAHO with this approach, to say nothing of
> malpractise lawyers! In hand written notes, a health care provider cannot
[quoted text clipped - 16 lines]
> I'm 4+ busy right now, but I'll dig around and post some example back here in
> a day or two, if you're interested!
Dirk Goldgar - 29 May 2007 23:48 GMT
> You're going to run afoul of JCAHO with this approach, to say nothing
> of malpractise lawyers! In hand written notes, a health care provider
[quoted text clipped - 17 lines]
> I'm 4+ busy right now, but I'll dig around and post some example back
> here in a day or two, if you're interested!

Well posted, missinglinq!

Signature

Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

RobUCSD - 30 May 2007 00:27 GMT
Surely there must be a way to only allow the current new record to be editable;

If Me.NewRecord And Me.CurrentRecord Then
Me.allowedits = True Else
Me.allowedits = False

I've tried this and it doesn't work, Why not?

Thanks, Rob

> > You're going to run afoul of JCAHO with this approach, to say nothing
> > of malpractise lawyers! In hand written notes, a health care provider
[quoted text clipped - 19 lines]
>
> Well posted, missinglinq!
Dirk Goldgar - 30 May 2007 03:15 GMT
> Surely there must be a way to only allow the current new record to be
> editable;
[quoted text clipped - 4 lines]
>
> I've tried this and it doesn't work, Why not?

I think all you need is this:

   Me.AllowEdits = Me.NewRecord

Me.CurrentRecord is just the record number of the current record, so
using it in a logical expression like the above makes no sense.
Me.NewRecord always refers to the status of the form's current record.

Signature

Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.