Disabled Text Boxes Based on Value of Another Text Box

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.
 
J

Julia B

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
 
D

Douglas J. Steele

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")
 
S

Sherry N.

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?
 
J

Jan Baird

Jan Baird is out of the country until September 20. Every effort will be
made to respond to messages, but please be patient.
 

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