Minor Syntax question

P

Plumdodge

I am trying to set the the distance for the boxGrowForDate from the left with
the following expression. The control however never moves as though the
Parentheses portion returns zero. Do I have a syntax error?



Me.ScaleMode = 5 'Inches
sngFactor = Me.boxMaxDays.Width / mintDayDiff ''4.2/5 = .82 ''
Me.boxGrowForDate.left = Me.boxMaxDays.left + (intStartDayDiff * sngFactor)

Thanks for any advice!
 
D

Douglas J. Steele

What's the value of intStartDayDiff?

Hopefully you realize that when you manipulate properties such as Left in VB
code, you must use twips (there are 1440 twips to the inch, or 567 twips to
the centimeter). In other words, .82 times some small value isn't going to
result in a noticeable shift in the box.
 
P

Plumdodge

Doug, Thanks that is good to know and will save me from pulling out my hair

intStartDayDiff = Abs(DateDiff("d", IIf(Me.T_Start_Date < mdatEarliest,
mdatEarliest, Me.T_Start_Date), mdatEarliest))


With me.t_start_date is the starting date of the task being measuring
And mdatearliest as the earlist date measured in the timeline contol

Thanks for the help!
 
P

Plumdodge

Doug, Thanks that is good to know and will save me from pulling out my hair

intStartDayDiff = Abs(DateDiff("d", IIf(Me.T_Start_Date < mdatEarliest,
mdatEarliest, Me.T_Start_Date), mdatEarliest))


With me.t_start_date is the starting date of the task being measuring
And mdatearliest as the earlist date measured in the timeline contol



I throw a text box on the report just to make sure what was happening

Me.Text54 = intStartDayDiff * sngFactor

It returns 0 on a few (which is correct) and a few others have values of
3120,4680
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top