complex iif statement (1 Viewer)

morning1001

New member
Local time
Today, 11:01
Joined
Aug 8, 2000
Messages
7
Is it possible to have an iif statement build upon multiple conditions?

I would liketo change the formatting of the report when three conditions are met...
 

morning1001

New member
Local time
Today, 11:01
Joined
Aug 8, 2000
Messages
7
I figured it out...

If [Single Family] = 90 Then
If [Duplex] = 10 Then
If [Apartments] = 20 Then
[Single Family].ForeColor = 16711680
[Duplex].ForeColor = 16711680
[Apartments].ForeColor = 16711680
Else
[Single Family].ForeColor = 0
[Duplex].ForeColor = 0
[Apartments].ForeColor = 0
End If
Else
[Single Family].ForeColor = 0
[Duplex].ForeColor = 0
[Apartments].ForeColor = 0
End If
Else
[Single Family].ForeColor = 0
[Duplex].ForeColor = 0
[Apartments].ForeColor = 0
End If
 

Fornatian

Dim Person
Local time
Today, 11:01
Joined
Sep 1, 2000
Messages
1,396
There's no need to put the repeating code in all you need to do is add AND in your if statement like...

If [Single Family] = 90 AND [Duplex] = 10 AND [Apartments]= 20 Then
[Single Family].ForeColor = 16711680
[Duplex].ForeColor = 16711680
[Apartments].ForeColor = 16711680
Else
[Single Family].ForeColor = 0
[Duplex].ForeColor = 0
[Apartments].ForeColor = 0
End If

Hope that's a bit more concise for you...

Ian
 

Users who are viewing this thread

Top Bottom