Variable Length For Box On Report

R

Robert_DubYa

I am making a scheduling database for my shop. I would like to have a line
(or box in this case) represent the duration of a job. There will be
multiple jobs so the box length may be between 0" and 8" long (the actual
length in inches is the number of days and is in a column in my query). I
can not for the life me figure out how to get the variable length to work as
you can only add a number in the properties field (this is actually
considered the width in the property of a box) and not reference a cell. Any
suggestions?

thanks!
Robert
 
B

Beetle

You should be able to do it programmatically. The thing to remember
when manipulating control sizes in code is that you are working
with TWIPS, not inches.

If you are doing this in a Report use the On Format property of
the Detail section and put code like;

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

Me![YourTextBox].Width = Me![YourNumberField] * 1440

End Sub

(there are 1440 TWIPS per inch)
 
Top