Link to home
Start Free TrialLog in
Avatar of mytfein
mytfein

asked on

Access: rectangle object - programmatically resizing rectangle

Hi EE,
I learned from this site how to resize a rectangle using the WIDTH property

https://www.experts-exchange.com/questions/20643295/Making-a-graph-from-a-field-in-a-report.html?sfQueryTermInfo=1+graph+report+sub

for ex:
   rctHPbar.Width = (Me.txtHPcount / 100) * (1440 * lngBarMaxInches)

I am having trouble modifying the HEIGHT property of rectangel.
It is growing SOUTHWARD, and would like it to grow NORTHWARD.

Any ideas? (I tried multiplying the above by -1, but got an error msg)

tx, sandra
Avatar of ErezMor
ErezMor
Flag of Australia image

you say you have a problem with the height formula, but you provided only the width formula.
can you post your problematic height formula, so i can suggest a solution?
ASKER CERTIFIED SOLUTION
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mytfein
mytfein

ASKER

Thx guys for replying:

Erez:
     it's the same formula, just used   "dot" Height  as in:  .Height =

Mx:
     Thx, amazing! I could spend days here.....

LSM:
a)      I see a Top property,
b)      so if the rect is set at 3 ", and I should set top property to 1"  to "mimic" that
      column is growing northward
               - but -
      really growing southward from a higher top value point
                      to give an illusion of going northward
c) if (b) is true, the challenge is in correctly calculating the top value from which to start the
    movement south?

    There is no bottom property. If there was,  perhaps a formula could be created to calculate
    top value and length of bar.

Guys, I'm going out for a walk to rest my brain, will be in touch.... tx, s

    please reply....tx, sandra          
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The other issue I see is interaction with other controls. I'm not sure how well the controls above this one will resize if you do this.

Why does the control need to grow upwards?

< There is no bottom property>

No, but there is Top + Height, which is, in effect, the "bottom".
Avatar of mytfein

ASKER

Hi Erez,

Thx for the code.
I'm getting an error: 2100 the control or subform control is too large for this location...
let me see if I can post a test mdb, in case you want see the error...

tx, s
Avatar of mytfein

ASKER

Hi LSM,
Progression of events:
a) First created Access/MS graph for all courses for 1st year students
    screen shot 1
b) User really wants an arrow pointing to the bar that the student falls under.
     This graph is from a pdf from a website. I was told that this sample was created 10 years ago
     so no on technical at this website for me to talk to.
    screen shot 2
c) so I posted asking if possible to add "moving" arrow to graph
     https://www.experts-exchange.com/questions/24583997/Bar-Graphs-Can-I-draw-arrows-in-a-graph-like-the-sample-screen-shot-below.html

     PuppyDogBuddy gave me code for arrows, have not explored it yet as his sample says
     ActiveSheet, and I'm working out of Access

d)   Also while waiting for an EE answer of (c) figured I would try another approach to have
     another option to show my user

     using an old EE post: listed in this post in my initial quest., I learned about resizing rectangles,
     so i created a 2 column self-graph report
     3rd screen shot

e) I was thinking, in case user wants the bars vertical instead of horizontal,
     so I posted this quest.
     4th screen shot (in design view - bec. not working)

f) Also, I posted at EE inquirying about Harvard Graphics and other possible chart software that
    could give me the control of drawing an arrow programmatically.

g) attached test mdb

h) btw, pls visit (c) if you have any thoughts....
tx for your time, s
     
FridayGraph.GIF
GraphWithArrows.GIF
HorizSelfGraph.GIF
VertSelfGraph.GIF
090720-graph.mdb
I believe you'd need two separate images for each one (or two different reports, one with horizontal grapsh and one with vertical graphs. Moving controls during runtime is doable, but often doesn't product positive results (since when/where they're moved can have an impact on the final rendering).
Avatar of mytfein

ASKER

Hi LSM,

oh i will not be mixing controls...

first experimented with sefl-graph: horizontal direction
I'm actually proud of it....

In case, user wants vertical to look like the pdf sample above, i began experimenting with
self-vertical

if i could get arrows to work on MS graph as per (c), then that would make me happy, too.
Just wanted to try all kinds of graphs for user to pick from....

tx, s
Still, you'll be better off with two different reports, although I'd do some "user studies" to see if something like this is a desirable feature, or if you're wasting time (can't tell you how many times that has happened <g>).
Avatar of mytfein

ASKER

Hi everyone,

this is the test mdb, tx, s
090720-graph.mdb
Avatar of mytfein

ASKER

Hi LSM,

2 diff reports, do you mean:
a) horizontal bar direction
b) vertical bar direction

if so, that's what I am doing. If i get vertical to run easily, will go with vertical.
if it's not easy, will tell that to user .....

tx for your help guys, will be in touch tomm., tx, s
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mytfein

ASKER

Hi Erez,
I understand you... I am having trouble... maybe this is not possible...sigh....
a) If I just run to graph one row, by putting a filter on my query for:  "MEDI 1100" course
    I do not get an error about control size.
b) While I expanded report to portrait: 8 by 11
    when I run with many records, the error msgs occurs
c) I just realized this morning:
    I do not understand the  2nd subtraction of height here:
    rctHPbar.Top = rctHPbar.Top - ((Me.txtHPcount / 100) * (1440 * lngBarMaxInches)-rctHPbar.Height
d) If i wanted to dissect the code by creating variables such as:
          BarLength = Me.txtHPcount / 100
          RevisedTop =   math formula
     Would I make these fields: a Double data type to capture decimal numbers?
   
Pls advise, i think it's time to close this post as resolved, as i did get info... and perhaps open new related posts...
tx, s
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mytfein

ASKER

Hi Erez,
Thx for writing....

Pls i need this post as resolved,  and split the points bec. everyone offered ....
(another EE   recently explained to me, that too many quests. in one post are not allowed... so want
to abide by rules)

then I will post a related post, where you can answer...... if you like....

I will send you the link of new post so that you can jump in.... tx, sandra