0

I need this to effect only the current record within the continuous form.

On the Offender Type I select "offender 1" and the code correctly sets all four fields not enabled.

However when I go record 2, in the Offender Type, I select "Offender 2" the code incorrectly sets all four fields to enabled of every record of the continuous form not just the fields for record 2.

Combo box Name: Offender_Type Selections for Offender_Type: Offender 1; Offender 2; Offender 3

Private Sub Offender_Type_AfterUpdate()
If Me.Offender_Type.Value = "offender 1 " Then
    Me.Field1.Enabled = False
    Me.Field2.Enabled = False
    Me.Field3.Enabled = False
    Me.field4.Enabled = False
ElseIf Me.Offender_Type.Value <> "offender 1" Then
    Me.Field1.Enabled = True
    Me.Field2.Enabled = True
    Me.Field3.Enabled = True
    Me.field4.Enabled = True
Else
End If
End Sub
Jason_P
  • 1
  • 1
  • 2
    Does this answer your question? [Label and Enable/Disable a button on a continuous form based upon text control value](https://stackoverflow.com/questions/9744559/label-and-enable-disable-a-button-on-a-continuous-form-based-upon-text-control-v) – Erik A Dec 17 '19 at 19:05
  • 2
    In short: you can't, but you can use conditional formatting to make it look disabled, and VBA to disallow data entry. – Erik A Dec 17 '19 at 19:05
  • Thank you I will try conditional formating – Jason_P Dec 17 '19 at 20:54

0 Answers0