Code Newbie Problem!

Johnrg

Registered User.
Local time
Tomorrow, 03:41
Joined
Sep 25, 2008
Messages
115
Guys,
I have a report that has three unbound text boxes and three bound customer address feilds.
I am trying to put in some code that basically says if there is no data in the any of the bound customer address feilds move everything up a text box to make the report look pretty.
Heres the code - what Am I doing wrong - be gentle on the code speak!
Code:
[INDENT]If Not IsNull([Customers.Postal Code]) Then txtaddress1 = ([Customers.Postal Code])
If Not IsNull([Customers.City]) Then txtaddress2 = ([Customers.City])
If Not IsNull([State Or Province]) Then txtaddress3 = ([State Or Province])
[/INDENT]Else
[INDENT]If Not IsNull([State Or Province]) Then txtaddress2 = ([State Or Province])
txtaddress3 = Null
Else
txtaddress2 = Null
txtaddress3 = Null
[/INDENT]End If
 
Else
[INDENT]If Not IsNull([Customers.City]) Then txtaddress1 = ([Customers.City])
[/INDENT][INDENT]If Not IsNull([State Or Province]) Then txtaddress2 = ([State Or Province])
txtaddress3 = Null
Else
txtaddress2 = Null
txtaddress3 = Null
[/INDENT]End If
 
Else
[INDENT]If Not IsNull([State Or Province]) Then txtaddress1 = ([State Or Province])
[/INDENT]txtaddress2 = Null
txtaddress3 = Null
Else
txtaddress1 = Null
txtaddress2 = Null
txtaddress3 = Null
[INDENT][INDENT]End If
[/INDENT]End If
[/INDENT]End If
Ta
JG
 
Last edited:
Edit your post in advanced mode.
Enclose the code in code tags (highlight and press # button in toolbar)
Indent the code so it is more readable.
 
Maybe I don't understand your objective, but this seems like an overcomplicated way of doing this. Are you aware of can shrink and nz? For instance, if you want to hide a field that happens to be empty, just make sure that field is set to can shrink = yes in the properties. If you want to a field to have a value if it comes up empty, write
= nz([field value],"whatever it should say if it is null")
 

Users who are viewing this thread

Back
Top Bottom