Single Record Lock in a Continuous Form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way I can lock a single record in a continuous form to be non
editable? I have a a check box for each record that is "confirmed", if the
status of Confirmed is true, then the record cannot be edited.

Many thanks for your suggestions

Wendy
 
Is there a way I can lock a single record in a continuous form to be non
editable? I have a a check box for each record that is "confirmed", if the
status of Confirmed is true, then the record cannot be edited.

Many thanks for your suggestions

Wendy
use the onfocus event and something like:
if me.confirmed then
docmd.GoToRecord ,,acNext
endif

take care: not tested, it will fail on EOF
 
In Form_Current

if confirmed = -1 then
Me.Field1onTheSubform.Locked = True
Me.Field2onTheSubform.Locked = True
...
else
Me.Field1onTheSubform.Locked = False
Me.Field2onTheSubform.Locked = False
...
end if

HTH,
Debbie


| Is there a way I can lock a single record in a continuous form to be non
| editable? I have a a check box for each record that is "confirmed", if the
| status of Confirmed is true, then the record cannot be edited.
|
| Many thanks for your suggestions
|
| Wendy
 
Hi,
Thanks for the solution. I tried it, but it seems to lock all the records. I
also wanted it to change colour when the confirmed check box was ticked, but
it screwed up the locking and turned everything red.

I got this far and have tried interspersing with .forecolour=vbRed etc, but
to no avail.

f Me.Confirmed = -1 Then
Me.txtDate.Locked = True
Me.Time.Locked = True
Me.Event_Type.Locked = True
Me.Description.Locked = True
Me.Owner.Locked = True
Me.SportsEvent.Locked = True
Me.KeyEvent.Locked = True
Else
Me.txtDate.Locked = False
Me.Time.Locked = False
Me.Event_Type.Locked = False
Me.Description.Locked = False
Me.Owner.Locked = False
Me.SportsEvent.Locked = False
Me.KeyEvent.Locked = False
End If

Any other suggestions would be appreciated. I migh try MW's suggestion, but
again, it will be a usability issues, staff will call me because they can't
select the locked record
 
One more shot:

change the Else to

ElseIf Me.Confirmed = 0 Then
....


Me.YourFieldName.ForeColor = vbRed
remember to change it back to whatever you want


| Hi,
| Thanks for the solution. I tried it, but it seems to lock all the records.
I
| also wanted it to change colour when the confirmed check box was ticked,
but
| it screwed up the locking and turned everything red.
|
| I got this far and have tried interspersing with .forecolour=vbRed etc,
but
| to no avail.
|
| f Me.Confirmed = -1 Then
| Me.txtDate.Locked = True
| Me.Time.Locked = True
| Me.Event_Type.Locked = True
| Me.Description.Locked = True
| Me.Owner.Locked = True
| Me.SportsEvent.Locked = True
| Me.KeyEvent.Locked = True
| Else
| Me.txtDate.Locked = False
| Me.Time.Locked = False
| Me.Event_Type.Locked = False
| Me.Description.Locked = False
| Me.Owner.Locked = False
| Me.SportsEvent.Locked = False
| Me.KeyEvent.Locked = False
| End If
|
| Any other suggestions would be appreciated. I migh try MW's suggestion,
but
| again, it will be a usability issues, staff will call me because they
can't
| select the locked record
|
| "DebbieG" wrote:
|
| > In Form_Current
| >
| > if confirmed = -1 then
| > Me.Field1onTheSubform.Locked = True
| > Me.Field2onTheSubform.Locked = True
| > ...
| > else
| > Me.Field1onTheSubform.Locked = False
| > Me.Field2onTheSubform.Locked = False
| > ...
| > end if
| >
| > HTH,
| > Debbie
| >
| >
| > | > | Is there a way I can lock a single record in a continuous form to be
non
| > | editable? I have a a check box for each record that is "confirmed", if
the
| > | status of Confirmed is true, then the record cannot be edited.
| > |
| > | Many thanks for your suggestions
| > |
| > | Wendy
| >
| >
| >
 
That's not going to work either ... I forgot this was a continuous form.


| One more shot:
|
| change the Else to
|
| ElseIf Me.Confirmed = 0 Then
| ...
|
|
| Me.YourFieldName.ForeColor = vbRed
| remember to change it back to whatever you want
|
|
| || Hi,
|| Thanks for the solution. I tried it, but it seems to lock all the
records.
| I
|| also wanted it to change colour when the confirmed check box was ticked,
| but
|| it screwed up the locking and turned everything red.
||
|| I got this far and have tried interspersing with .forecolour=vbRed etc,
| but
|| to no avail.
||
|| f Me.Confirmed = -1 Then
|| Me.txtDate.Locked = True
|| Me.Time.Locked = True
|| Me.Event_Type.Locked = True
|| Me.Description.Locked = True
|| Me.Owner.Locked = True
|| Me.SportsEvent.Locked = True
|| Me.KeyEvent.Locked = True
|| Else
|| Me.txtDate.Locked = False
|| Me.Time.Locked = False
|| Me.Event_Type.Locked = False
|| Me.Description.Locked = False
|| Me.Owner.Locked = False
|| Me.SportsEvent.Locked = False
|| Me.KeyEvent.Locked = False
|| End If
||
|| Any other suggestions would be appreciated. I migh try MW's suggestion,
| but
|| again, it will be a usability issues, staff will call me because they
| can't
|| select the locked record
||
|| "DebbieG" wrote:
||
|| > In Form_Current
|| >
|| > if confirmed = -1 then
|| > Me.Field1onTheSubform.Locked = True
|| > Me.Field2onTheSubform.Locked = True
|| > ...
|| > else
|| > Me.Field1onTheSubform.Locked = False
|| > Me.Field2onTheSubform.Locked = False
|| > ...
|| > end if
|| >
|| > HTH,
|| > Debbie
|| >
|| >
|| > || > | Is there a way I can lock a single record in a continuous form to be
| non
|| > | editable? I have a a check box for each record that is "confirmed",
if
| the
|| > | status of Confirmed is true, then the record cannot be edited.
|| > |
|| > | Many thanks for your suggestions
|| > |
|| > | Wendy
|| >
|| >
|| >
|
 
Back
Top