Error 2166 - unable to lock field after update

  • Thread starter Thread starter True
  • Start date Start date
T

True

Hi there,

I'm triggering the following SQL sentence after a click event in order
to update some fields:

DoCmd.RunSQL "UPDATE Interfície SET " _
& "[Date] = MyDate.Value " _
& "WHERE ([Id_Apl] = MyApl.Value AND " _
& "[Id_Interfase] = Interfase.Value);"

This works nicely but when locking the field "MyDate" (unbound) to
avoid further editing I get the error 2166 informing me I cannot lock
a field that hasn't been updated yet.

After some google search efforts I've tried the Me.Dirty = False
method with no success.

Any help will be greatly appreciated,

Thanks
J
 
As the control is Unbound, set its Enabled property to
False to prevent any further changes.

Hope That Helps
Gerald Stanley MCSD
 
Gerald,

does that means that we only can set the Enabled property of a field
to False and that we cannot change its Locked property in the case J
describes?


Thanks,
Susanna


Gerald Stanley said:
As the control is Unbound, set its Enabled property to
False to prevent any further changes.

Hope That Helps
Gerald Stanley MCSD
-----Original Message-----
Hi there,

I'm triggering the following SQL sentence after a click event in order
to update some fields:

DoCmd.RunSQL "UPDATE Interf cie SET "
& "[Date] = MyDate.Value "
& "WHERE ([Id Apl] = MyApl.Value AND "
& "[Id Interfase] = Interfase.Value);"

This works nicely but when locking the field "MyDate" (unbound) to
avoid further editing I get the error 2166 informing me I cannot lock
a field that hasn't been updated yet.

After some google search efforts I've tried the Me.Dirty = False
method with no success.

Any help will be greatly appreciated,

Thanks
J
.
 
Back
Top