Disabled Text Boxes Based on Value of Another Text Box

  • Thread starter Thread starter Sherry N.
  • Start date Start date
S

Sherry N.

Hello,
I need to disable two of my text boxes based on the value of another.
I want to use something like this but am sure I am not using the correct
syntax.

If Me.Branch_Code = "SFCO" Or "SFPA" Then
Me.RR_Rerun_Received.Enabled = False and Me.CR_Rerun_Received.Enabled = False
Else
Me.RR_Rerun_Received.Enabled = True and Me.CR_Rerun_Received.Enabled = True

End If

Great thanks.
Sherry N.
 
Try:

If Me.Branch_Code.Text = "SFCO" Or Me.Branch_Code.Text = "SFPA" Then
Me.RR_Rerun_Received.Enabled = False
Me.CR_Rerun_Received.Enabled = False
Else
Me.RR_Rerun_Received.Enabled = True
Me.CR_Rerun_Received.Enabled = True
End If

Julia
 
Or, a little shorter,

Me.RR_Rerun_Received.Enabled = _
(Me.Branch_Code.Text <> "SFCO" And Me.Branch_Code.Text <> "SFPA")
Me.CR_Rerun_Received.Enabled = _
(Me.Branch_Code.Text <> "SFCO" And Me.Branch_Code.Text <> "SFPA")
 
Thanks but I am getting an error Method or data member not found for the
..Text? I am using this in the After Update property for the Branch Code Text
box. Could that be the problem?
 
Jan Baird is out of the country until September 20. Every effort will be
made to respond to messages, but please be patient.
 
Back
Top