Disabling a single record from a subtable

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a subtable on a form. One of the fields is a combo box. Is there
anyway to code it so that if the 2nd value of the combo box is selected that
the particular record that field is attached is disabled. I still want the
other records in the table to have read/write access. I hope I explained that
right.

Thanks!
 
In the BeforeUpdate event, check the value of the field of interest. When
the field has the desired value, then cancel the event and display a message
box.

BrerGoose
 
Hi BrerGoose,

Let me see if I can explain better. Say I have a table with three records in
it, with one of those fields in each record a drop down box. Can I have it so
that if value 2 in record 2 is selected in the drop down box that record 2
can be disabled in the form and record 1 and record 3 still have read/write
access?
 
You can use the locked property in the Form Current Event

Private Sub Form_Current()
If Me.Combo0.Value="lock" Then
Me.Ctl1.Locked = True
Me.Ctl2.Locked = TRue
Else
Me.Ctl1.Locked = False
Me.Ctl2.Locked = False
End If
End sub

HtH

Pieter
 
Back
Top