Re: Limiting the times a record can be updated
- From: John Vinson <jvinson@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 19 Sep 2005 13:33:50 -0600
On Mon, 19 Sep 2005 12:02:02 -0700, "Sean Skallerud"
<SeanSkallerud@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
>Here is my dilemma, I need a user to be allowed to edit a record, but they
>will only be able to edit said record one time.
>
>They will be doing this in a continous form based off a query (which is
>based off of 3 tables). There will be between 5 and 20 records that will be
>displayed on the form at any given time (for the number of people that report
>to that supervisor). We do not want any of the records being updated more
>than one time.
>
>How would I go about doing this? Thanks in advance for any help that is
>offered.
You would need to have an additional field in the Table to indicate
that the record has been updated. I'd use a Yes/No field,
HasBeenUpdated, and set it to False by default, and to True in the
Form's AfterUpdate event.
In the form's Before update event, check the value of HasBeenUpdated
and cancel the update if it's true:
Private Sub Form_BeforeUpdate(Cancel as Integer)
If Me!HasBeenUpdated Then
Cancel = True
MsgBox "You already updated this once. Sorry; you had your chance!"
End If
End Sub
John W. Vinson[MVP]
.
- Prev by Date: Re: Referencing a field in a subform
- Next by Date: Re: Which event to display "Report printed" message?
- Previous by thread: Re: Referencing a field in a subform
- Next by thread: Re: Limiting the times a record can be updated
- Index(es):
Relevant Pages
|