Locking a few field

  • Thread starter Thread starter Simon
  • Start date Start date
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
 
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
 
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

Back
Top