Multiple If criteria in code

  • Thread starter Thread starter GD
  • Start date Start date
G

GD

How would I go about coding something on my list below to be visible if there
was more than one criteria, i.e. the box is checked AND the $ amount of, say,
Text1 is less than $2000?

Private Sub Form_Current()
Combo206.Visible = Check195
Combo269.Visible = Check195
Text267.Visible = Check195
Label300.Visible = Check195Combo213.Visible = Check209
Text215.Visible = Check209
Text217.Visible = Check209
Label221.Visible = Check209
Combo219.Visible = Check209
End Sub

I appreciate your time and effort!
 
Something like

Private Sub Form_Current()
Me.Combo206.Visible = (Me.Check195 And Me.Text1 < 2000)
Me.Combo269.Visible = (Me.Check195 And Me.Text1 < 2000)
Me.Text267.Visible = (Me.Check195 And Me.Text1 < 2000)
Me.Label300.Visible = (Me.Check195 And Me.Text1 < 2000)
End Sub

Incidentally, do yourself a HUGE favour, and rename your controls to
something meaningful!
 
Back
Top