Locking a few field

S

Simon

On a form if i have a tick box 'OrderComplet"

I would like some code that will lock the following text boxes if
"ORderComplete" is ticked

txtOrderNumber
txtORderDate
txtTotal
txtDespatchDAte


Thanks
 
D

Duane Hookom

I would add "LockComplete" in each of the tag properties of these controls.
Then use code in the after update of the tick box like:

Dim ctl As Control
For Each ctl in Me.Controls
If ctl.Tag = "LockComplete" Then
ctl.Locked = Me.OrderComplet
End If
Next
 
D

Duane Hookom

In addition, you might want to call the after update code in the On Current
event of the form.
 

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