locking fields in form based on values in other fields.

K

Kay

I have a form with a field, called dobest, that collects
info for an instructor.

There are up to 3 instructors for each record. If there
is only one instructor, I'd like to lock the other two
dobest fields.

How do I do this?

Thanks,
Kay
 
W

Wayne Morgan

Since you know that there is only one instructor, I'm guessing the record already exists
and you don't want someone to be able to add a 2nd or 3rd instructor.

In the Form's OnCurrent event, check the 2nd and 3rd instructor control (i.e. textbox) and
if it is blank set its Enabled property to False.

Example:
If IsNull(Me.txtInstructor2) Then
Me.txtInstructor2.Enabled = False
Else
Me.txtInstructor2.Enabled = True
End If
 
W

Wayne Morgan

It appears that you're typing in the fields, you can't lock the fields but you can lock
the controls that hold the fields. The example I gave would be for a control (textbox,
combobox, listbox, combobox, etc) on 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