Horizontal position on report (1 Viewer)

g-richardson

Registered User.
Local time
Today, 05:47
Joined
Mar 4, 2005
Messages
42
Can I move a column horizontal postion based on another column?

I have column A, B, C & D

I would like to have Column C slide left if no data in column B.

Is this possible?

Thanks,
George
 

grnzbra

Registered User.
Local time
Today, 10:47
Joined
Dec 5, 2001
Messages
376
This should be very easy. In the OnOpen event dim HorPos as Long and use a series of If statements to check the values for null. After defaulting HorPos to the leftmost postion, check FieldA for null. If it is null set it's visible property to false. If it is not null set it's horizontal (left property) equal to HorPos and add the horizontal shift value for the next field to HorPos. Repeat the process for each field in turn. When I did something like this, I had to specify position in "twips". There are 1440 twips per inch.

On second thought, though, that might not work for the detail section. If it doesn't work, try setting up four calculated fields (may have to do this in a query) and us an IIf statement to check for nulls and select the appropriate field. For example RptFieldA = IIf(FieldA, FieldA, IIf(FieldB, FieldB,IIf(FieldC,FieldC,FieldD), RptFieldB = IIf(FieldA and FieldB, FieldB, IIf(FieldC, FieldC, FieldD).

Something like that. It may be easier to set them up in a query and then just feed the query straight into the report.
 
Last edited:

g-richardson

Registered User.
Local time
Today, 05:47
Joined
Mar 4, 2005
Messages
42
Still working the code

Thanks grnzbra, I think you have put me on the right track. I'm trying to work it out. When I finish, I'll post how I did it...

Thanks again.

G
 

Users who are viewing this thread

Top Bottom