If Then Else AND....

rgreene

Registered User.
Local time
Today, 22:37
Joined
Jan 22, 2002
Messages
168
Is there a way for in the else part of the code to have 2 things happen?
I have this:

If Me.Family = "1" Then
Me.FamPoints = "3"
ElseIf Me.Family = "2" Then
Me.FamPoints = "2"
ElseIf Me.Family = "3" Then
Me.FamPoints = "1"
ElseIf Me.Family = "4" Then
Me.FamPoints = "0"
ElseIf Me.Family = "4" Then
Me.FamOther.Visible = True

This isn't making the FamOther visable. Is there a way to combine the last 2 lines in 1 so if me.Family = "4" then FamPoints = "0" AND FamOther becomes visable? Or am I doing it right just need to figure out why it's not visable?

Thanks in advance,
Rick
 
You would do this:

Code:
Else If (Me.Family = "4" Then
        Me.FamPoints = "0"
        MeFamOther.Visible=True
    Else...

And if I could offer another suggestion. As long as you have shown all the cases you can tighten up the coding further by this:

Me.FamPoints = 4 - Me.Family

That would calculate Me.FamPoints for every case eliminating all those If/Else statements.
 
Where does the other ) go?

Else If (Me.Family = "4" Then
Me.FamPoints = "0"
MeFamOther.Visible=True
Else...

I am definatley open for suggestion but I'm not following what you are saying with the suggestion. I'm not very good at this coding stuff.
 
Sorry about that stray parenthesis, you can omit it.
 

Users who are viewing this thread

Back
Top Bottom