Error 2166 - unable to lock field after update

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
 
G

Gerald Stanley

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

Hope That Helps
Gerald Stanley MCSD
 
S

sgasac

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
.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top