Re: How to make the form read only when field status is CLOSED
- From: "Carl Rapson" <mr.mxyzptlk@xxxxxxxxxxxxxxxxx>
- Date: Thu, 18 Oct 2007 10:10:48 -0500
"Mario" <Mario@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:4A6355C0-E83A-4A32-AD13-CA8F9F30C93D@xxxxxxxxxxxxxxxx
I have a DB of Issues, there is a field Status (Active Closed Resolved).
I need when a person change the STATUS field to CLOSE to automatticaly set
the Edit to "NO" so the fields in the form would show in Read Only, BUT
leave
the field STATUS open for edits to Reopen the Issue. I may have an idea
how
to do that but don't know how to coded, can these be done with a macro or
VB
code. Can somebody give me some direction?
Tks in advance.
Mario
Since you want to lock all but a single field you'll need to loop through
all controls on the form and set each one's Locked property to True. Create
a sub procedure something like this:
Sub LockControls(bLock As Boolean)
Dim ctl As Control
For Each ctl In Me.Controls
If ctl.Tag = "Lock" Then
ctl.Locked = bLock
End If
Next ctl
End Sub
For each control you want locked, enter the text "Lock" (without the quotes)
into the Tag property. Then, in the AfterUpdate event of the STATUS field,
call LockControls and pass the appropriate Boolean value:
If Me.STATUS = "CLOSE" Then
LockControls True
Else
LockControls False
End If
Carl Rapson
.
- Follow-Ups:
- Re: How to make the form read only when field status is CLOSED
- From: Pieter Wijnen
- Re: How to make the form read only when field status is CLOSED
- Prev by Date: Re: Recordsets and Forms
- Next by Date: Re: Forms not saving
- Previous by thread: Count of Weekdays Between Two Dates
- Next by thread: Re: How to make the form read only when field status is CLOSED
- Index(es):
Relevant Pages
|