Re: lock record code

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



bLock is a local variable to the routine. It isn't stored anywhere (nor is
it accessible from code in any other part of the database)

In actual fact, it isn't critical to the routine. It could just as easily
have been written as:

Private Sub Form_Current()

If Me.[Year] = 2004 Then
Me.AllowEdits = False
Me.AllowDeletions = False
Me.AllowAdditions = False
Else
Me.AllowEdits = True
Me.AllowDeletions = True
Me.AllowAdditions = True
End If

End Sub


--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Steel via AccessMonster.com" <u15374@uwe> wrote in message
news:56b919aa6609c@xxxxxx
> Is the variable bLock created in the process and, if so, where would this
> variable be stored?
>
> Thanks for the reply.
>
> Steel
>
> Douglas J Steele wrote:
> >Actually, all the first part
> >
> > If Me.[Year] = 2004 Then
> > bLock = True
> > End If
> >
> >does is set a variable to True if the year is 2004: it doesn't lock the
> >records.
> >
> >It's actually the second part that determines whether or not it's
supposed
> >to lock the records (by checking whether bLock is True), and then setting
> >the form's AllowEdits and AllowDeletions properties to False. (In actual
> >fact, you might also want to add Me.AllowAdditions = not bLock, so that
> >users cannot add new records to the database)
> >
> >> Hi,
> >>
> >[quoted text clipped - 19 lines]
> >>
> >> Steel


.



Relevant Pages

  • Re: Cross Platform FIFO Queue
    ... need a database to handle user accounts anyway. ... MySQL can handle record locking. ... If the database does not support the write lock at select ... I am in doubt that MySQL fully supports transaction ...
    (comp.programming.threads)
  • Re: Cross Platform FIFO Queue
    ... need a database to handle user accounts anyway. ... Hopefully MySQL can handle record locking. ... If the database does not support the write lock at select ... I am in doubt that MySQL fully supports transaction ...
    (comp.programming.threads)
  • Re: Parameterization of Object Models
    ... Lock down Access to the system -- ... Attempt to prevent deadlocks see The Concepts of Database Management, ... recovery; that is, you say that you recovered the database. ... database (called a backup or a save). ...
    (comp.lang.misc)
  • Re: Multiple ASTs for a Lock in a single process ?
    ... > inside my routine. ... When the shutdown comes into effect, ... > that the blocking AST only sets a flag. ... couldn't lock records against itself, ...
    (comp.os.vms)
  • Re: Limit FORM mailer submissions to 5 on website, then pause until reviewed by webmaster
    ... have a script that creates a temporary row in a sessions table as soon ... then don't display the input form and instead display the message, ... You wouldn't lock the file from the time they come to the page until ... the database occurs, ...
    (comp.lang.perl.misc)