Rectangle.HorizontalAnchor Property Issues (1 Viewer)

padlocked17

Registered User.
Local time
Today, 05:38
Joined
Aug 29, 2007
Messages
276
All,

I have been racking my brain over what I am sure is a stupid mistake. All I want to do is anchor a rectangle on my report to the right instead of the default left. The ultimate goal is a very simple, horizontal "waterfall" chart.

I've tried the following and I get "You've entered an expression that has an invalid reference to the property HorizontalAnchor".

Code:
Me.rectNegative.HorizontalAnchor = acHorizontalAnchorRight

I've also tried declaring a rectangle and then assigning it to a rectangle on the report, but I get a "Object Variable or With Block Not Set".

Code:
Dim rect As Rectangle
rect = Me.rectNegative

The reference for the property is http://msdn.microsoft.com/en-us/library/bb241881(v=office.12).aspx

Could someone please give me a pointer?

Thanks,
 

InitiallyMoved

New member
Local time
Today, 03:38
Joined
May 7, 2012
Messages
8
Object variable, you must use the "Set" keyword.

Code:
Dim rect As Rectangle
[B][COLOR=blue]S[/COLOR][COLOR=blue]et[/COLOR][/B] rect = Me.rectNegative

In addition, you sure rectNegative is a rectangle control ?
 

padlocked17

Registered User.
Local time
Today, 05:38
Joined
Aug 29, 2007
Messages
276
I double and tripled checked. Attached is a screenshot of the form. I tried setting the object variable, and it still is telling me there is an invalid reference.

I've got this in the onFormat event of the Detail section of the form if that has anything to do with it.

Any other ideas?
 

Attachments

  • form.GIF
    form.GIF
    31.1 KB · Views: 123

spikepl

Eledittingent Beliped
Local time
Today, 12:38
Joined
Nov 3, 2010
Messages
6,142
I am not sure what "simple, horizontal "waterfall" chart." is exactly. But someone just recently uploaded this (sorry, cannot remember the specific post) - perhaps you could use it :
 

Attachments

  • gantt drag drop_A2003.zip
    49.6 KB · Views: 100

Users who are viewing this thread

Top Bottom