Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IIf statement and a new line 1

Status
Not open for further replies.

jamespeters01

IS-IT--Management
Apr 3, 2001
75
GB
Hello,

I have an IIf statement in one of my reports which seems to work fine. I would like to instead of the fields listing across the page horizontally, jump to a new line after each record is diplayed.


=IIf(IsNull([Customer add 1]),[Customer add 5] & " " & [Customer add 6],[Customer add 1] & " " & [Customer add 2] & " " & [Customer add 3] & " " & [Customer add 4]) & " " & [Customer add 5] & " " & [Customer add 6]

This is my IIf statement

Any help would be appreciated !
 
Cosmo,

Why should I replace it with Forms! object ref ?? It doesn't really have anything to do with forms
 
James,

I sent you back your db. Let me know if that's what you're looking for.....
 
In the On format event of the detail section I assigned the value of txtCustAddress. If any of the address fields is null, I don't do anything. If they are not null, I move that
field, then a carriage return / line feed to the next line.
Code:
Me.txtCustAddress = IIf(IsNull(Me.[Customer add 1]), "", Me.[Customer add 1] & vbCrLf) & IIf(IsNull(Me.[Customer add 2]), "", Me.[Customer add 2] & vbCrLf) & IIf(IsNull(Me.[Customer add 3]), "", Me.[Customer add 3] & vbCrLf) & IIf(IsNull(Me.[Customer add 4]), "", Me.[Customer add 4] & vbCrLf) & IIf(IsNull(Me.[Customer add 5]), "", Me.[Customer add 5] & vbCrLf) & IIf(IsNull(Me.[Customer add 6]), "", Me.[Customer add 6])

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top