Show a field based on 3 possible options

Can anyone else add to this problem?

The code I have is...

Code:
Private Sub cboSchool_AfterUpdate()
 If Me.cboSchool = "2" Then
  Me.txtSchool.Visible = True
 Else
  Me.txtSchool.Visible = False
  Me.txtSchool.Value = Null
End If
End Sub

It is referring to the ID number "2".

I need it to be visible if cboSchool = "2" Or "3" Or "5", but the Or doesn't work.

Can someone offer something?
 
Think I have sorted it with this block IF statement

Code:
Private Sub cboSchool_AfterUpdate()
 If Me.cboSchool = "2" Then
  Me.txtSchool.Visible = True
Else
  If Me.cboSchool = "3" Then
  Me.txtSchool.Visible = True
Else
  If Me.cboSchool = "5" Then
  Me.txtSchool.Visible = True
Else
  Me.txtSchool.Visible = False
  Me.txtSchool.Value = Null
End If
End If
End If
End Sub
 
Answer was provided atleast 2 times:
GHudson: http://www.access-programmers.co.uk/forums/showpost.php?p=1003646&postcount=10
Leddy: http://www.access-programmers.co.uk/forums/showpost.php?p=1003403&postcount=2

also my attempts to convince you to do it another way seems to have failed :(

For some reason they would not work. I was getting an error everytime I selected an option from the drop down menu.

With your answer, I do not have a clue how to set it up.

I appreciate the help as always.
 
I tried resisting but ultimately failed ...

Find attached example for all 3, GHudson, Leddy and My solutions.
 

Attachments

I tried resisting but ultimately failed ...

Find attached example for all 3, GHudson, Leddy and My solutions.

Cheers, leddys now works but GHudson still errors.

I get your set up now. That is a good way. I will try to implement that now. ;)
 

Users who are viewing this thread

Back
Top Bottom