lock property

D

Dan

I want my form to load so that you can't change any
information in the records and if you want to change some
information then you have to click a button and then
change the data. Right now I have a for loop that checks
the tag property in the text boxes to see if there is a
the phrase "Lock" in it and if it finds it it, then it
will lock the text box. I was told this code would work
but it seems to have some problem.

Dim ctl As Control

For Each ctl In Me.Controls
If ctl.Tag = "Lock" Then ctl.Locked = True
Next ctl


it says that there is no lock property in ctl.
 
M

Media Lint

It depends on the type of control. Labels don't have a
locked property!

Text boxes, check boxes, list boxes, combo boxes do.

In the debug window, type:
? ctl.name

And see what control name it returns when it bombs out on
you. Then, check that control. I bet it doesn't have a
locked property! Your code otherwise should work.
 

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