If IsNull Then move fields below up

mhill31

New member
Local time
Today, 04:47
Joined
May 12, 2003
Messages
6
Hi,

I have an invoice (report) with fields listed down [company], [address2], [address1], [City, State, zip]. When [address2] is blank I want [address1] and [City, State, Zip] to move up. There are also occassions when both address lines would be blank in which case I want [city, state, zip] to move up two lines. Here is my code:

Private Sub GroupHeader0_Format(Cancel As Integer, FormatCount As Integer)

If IsNull(Me.strClAddress2) Then
strClAddress1.Move Left:=1415, Top:=570
strCityStZp.Move Left:=1415, Top:=820
End If

If IsNull(Me.strClAddress1) Then
strCityStZp.Move Left:=1415, Top:=570

End If

End Sub

The result is that both lines do move but they move even if [address2] or [address1] are not blank.

I realize I could easily combine [address1] and [address2] and it would be perfectly fine but this is more of a challenge at this point. Can anyone help?

Thanks very much,
Melissa
 
You do not need to do this with code, simply set the properties of the textbox to canshrink = yes in the format tab.
 
Thanks very much. I still needed the code to scoot the lines up so there were no blank lines in the address but once I set them all to Can Shrink, it stopped moving them up if the fields were not blank. Mystery solved. Thanks again. Now I can move onto my next challenge.

Melissa
 

Users who are viewing this thread

Back
Top Bottom