Here is the code to lock all the fields. As you can see, by using the TAG
property of a field, you can fine tune to only specific controls:
http://www.datastrat.com/Code/LockIt.txt

Signature
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
>I want to lock all the data fields in a form when I open it, leaving only
>the
[quoted text clipped - 24 lines]
>
> Any advice is appreciated!!
BMoroneso - 30 Jun 2008 17:31 GMT
Thanks for the code. I will try it out. Do you by chance know why the
.locked and/or .enabled properties are not working with the code that I wrote?
Thanks,
Becky
> Here is the code to lock all the fields. As you can see, by using the TAG
> property of a field, you can fine tune to only specific controls:
[quoted text clipped - 28 lines]
> >
> > Any advice is appreciated!!
Arvin Meyer [MVP] - 30 Jun 2008 18:57 GMT
My guess is that the first one that fails doesn't allow disabling or
locking. As soon as the code breaks, nothing else will work either. You
could try commenting out the first line that breaks, then rerunning the code
to see if anything else breaks. Only deal with the ones that break.

Signature
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
> Thanks for the code. I will try it out. Do you by chance know why the
> .locked and/or .enabled properties are not working with the code that I
[quoted text clipped - 36 lines]
>> >
>> > Any advice is appreciated!!
BMoroneso - 30 Jun 2008 21:42 GMT
It's just the combo boxes with sql as a source that break the code. I've
been through the 'commenting out' process and those are the only ones that
cause trouble. Other combo boxes with a value list work just fine.
> My guess is that the first one that fails doesn't allow disabling or
> locking. As soon as the code breaks, nothing else will work either. You
[quoted text clipped - 40 lines]
> >> >
> >> > Any advice is appreciated!!
BMoroneso - 30 Jun 2008 17:40 GMT
Also, I must be doing something wrong because the code didn't lock any of the
controls. Help?
> Here is the code to lock all the fields. As you can see, by using the TAG
> property of a field, you can fine tune to only specific controls:
[quoted text clipped - 28 lines]
> >
> > Any advice is appreciated!!
Arvin Meyer [MVP] - 30 Jun 2008 18:59 GMT
Set a breakpoint at the first line of code, and step through the code,
commenting out lines that error out.

Signature
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
> Also, I must be doing something wrong because the code didn't lock any of
> the
[quoted text clipped - 34 lines]
>> >
>> > Any advice is appreciated!!