Have Two If variables in Report Code

fenhow

Registered User.
Local time
Yesterday, 20:28
Joined
Jul 21, 2004
Messages
599
Hi,
I am trying to add another IF variable to a report.

This way it works perfectly.

Private Sub GroupFooter1_Format(Cancel As Integer, FormatCount As Integer)
If Me!Text214 < 1.66 Then

Me!minlang.Visible = True
Me!Text150.Visible = False
Me!Text218.Visible = False
Else
Me!minlang.Visible = False
Me!Text150.Visible = True
Me!Text218.Visible = True

End If

End Sub


What I am trying to do is add this to it.

If Me!OWNERINT = 1 Then
Me!minlang.Visible = False
Me!Text150.Visible = True
Me!Text218.Visible = False
Me!OWNERPAYOUT.Visible = True


But when I add it the report does not pull up. All controls are on the report.

Any suggestions?

Thanks.

Fen How
 
Without an End If, I'd expect that to throw a compile error.
 
Thanks Paul, so how should it go? Like this?

Private Sub GroupFooter1_Format(Cancel As Integer, FormatCount As Integer)
If Me!Text214 < 1.66 Then

Me!minlang.Visible = True
Me!Text150.Visible = False
Me!Text218.Visible = False

Else

Me!minlang.Visible = False
Me!Text150.Visible = True
Me!Text218.Visible = True

Else

If Me!OWNERINT = 1 Then
Me!minlang.Visible = False
Me!Text150.Visible = True
Me!Text218.Visible = False
Me!OWNERPAYOUT.Visible = True

End If

End Sub
 
Did you test it? That will throw a compile error because of the 2 Else bits. It would help to know the overall logic of what you're trying to accomplish (like does the last bit supersede the other, or ?).
 
I guess what I am trying to do is"

If Me!Text214 < 1.66 Then his happens:

Me!minlang.Visible = True
Me!Text150.Visible = False
Me!Text218.Visible = False

Else

Me!minlang.Visible = False
Me!Text150.Visible = True
Me!Text218.Visible = True

And if this is the case:

If Me!OWNERINT = 1 Then
Then This happens:

Me!minlang.Visible = False
Me!Text150.Visible = True
Me!Text218.Visible = False
Me!OWNERPAYOUT.Visible = True

Is there any way to have two If statements?

Thanks.
Fen
 
I want the last bit to be a part of the entire Sub, so if

This is the case If Me!Text214 < 1.66 then the respective happens

but

if this is the case : If Me!OWNERINT = 1 Then

it trumps the other.

Thanks.

Fen
 
You can certainly have:

Code:
If Whatever Then
  ...
Else
  ...
End If

If SomethingElse Then
  ...
End If
 
That was what I needed. Thank you so much.

While I have you, what would cause records to sometimes corrupt and fill with what appears to be Japanese or Chinese?

Fen
 

Users who are viewing this thread

Back
Top Bottom