width of a f eld

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a report that hase several fields that are printed across the page,
sometimes the fields are blank,

A second field is printed below these and is as wide as the page,
is it possible to adjust the width of this particular field using VB,
depending on which of the fields above it is teh last visible field

ie

field1 field2 field3 field4
fieldab

if field4 is null, then i want the width of field "fieldab" to be as wide as
3 * the width of field1, (fields1 to field4 all have the same width)
 
On the on format event of the section where the fields are, you can write the
code
If IsNull(Me.field4) Then
Me.fieldab.Width = Me.field1.Width * 2
Else
Me.fieldab.Width = Me.field1.Width * 3
End If
 
Back
Top