Can a btn or text box be placed up on graph? (1 Viewer)

Ashfaque

Student
Local time
Today, 18:03
Joined
Sep 6, 2004
Messages
894
Hi,

I would like to know if any unbound text box or a command btn can be on a graph that placed on a form.

I tried to keep one unbound text box over to graph / chart wherein some calculated value will appear after clicking a command btn.

I tried but it is going behind graph and only appearing when it generates some value after clicking the command btn.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 20:33
Joined
May 7, 2009
Messages
19,246
i don't think you can Overlay a graph with any control on top.
the graph is live.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 07:33
Joined
Feb 28, 2001
Messages
27,320
In Access since either 2007 or 2010 when a Chart utility upgrade occurred, I am fairly sure the answer to your question is now "No." Here is why I say that:

There is no such thing as a free-standing control because structurally, controls must be a member of an object.Controls collection. According to the MS reference on .Controls collections, the "parent" of such a collection must be a Form, Subform, or Report, or a specific type of control (such as the Tab control) that has the explicit ability to contain other controls (because it acts like a specific type of sub-form).



As I mentioned earlier, some years ago the MS Chart utility was updated to become the "new" charting utility. Since that upgrade, a chart is more like a complex control or object and less like a form/report on which controls could perhaps be placed. The current documentation for a chart object does not include a .Controls collection so offhand, I have to say "No, you can't do that."

 

oleronesoftwares

Passionate Learner
Local time
Today, 05:33
Joined
Sep 22, 2014
Messages
1,159
form graph design.PNG
form graph form view.PNG

@Ashfaque is this what you are trying to achieve?
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 07:33
Joined
Feb 28, 2001
Messages
27,320
@oleronesoftwares - did you do that by layering something else invisible over the chart? Because there is no structural element to anchor that control in a chart object, but the chart object can be in something else co-resident with a control. Please share that approach.
 

oleronesoftwares

Passionate Learner
Local time
Today, 05:33
Joined
Sep 22, 2014
Messages
1,159
@Doc man, the chart was converted to an image, then the unbound control was placed on it. also there is an option to send the image to the back.
 

June7

AWF VIP
Local time
Today, 04:33
Joined
Mar 9, 2014
Messages
5,493
I have Access 2010 and can place textbox and button on top of graph but cannot click button or click into textbox. Can tab into textbox.

Modern Chart was added with Access 2013.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 07:33
Joined
Feb 28, 2001
Messages
27,320
@Doc man, the chart was converted to an image, then the unbound control was placed on it. also there is an option to send the image to the back.

Ah, I see. It is no longer a chart object. It is an IMAGE of a chart of object, so you can overlay it with other things because it no longer represents live data.
 

oleronesoftwares

Passionate Learner
Local time
Today, 05:33
Joined
Sep 22, 2014
Messages
1,159
Ah, I see. It is no longer a chart object. It is an IMAGE of a chart of object, so you can overlay it with other things because it no longer represents live data
Attached are images of charts(i.e not converted to image) with a command button and unbound text.
Chartformview.PNG
chartdesign.PNG


So the two charts have the option send to back, while the command button and unbound text have the option send to front.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 07:33
Joined
Feb 28, 2001
Messages
27,320
Attached are images of charts(i.e not converted to image) with a command button and unbound text. View attachment 97524 View attachment 97525

So the two charts have the option send to back, while the command button and unbound text have the option send to front.
Check the OP's initial post, 3rd sentence, where the visibility of the "come to front" control is compromised under some circumstances. This is why I did the research I did and why I answered as I did.
 

Ashfaque

Student
Local time
Today, 18:03
Joined
Sep 6, 2004
Messages
894

isladogs

MVP / VIP
Local time
Today, 13:33
Joined
Jan 14, 2017
Messages
18,258
I don't know if its feasible as I haven't tried.
Why can't you just place your button adjacent to the chart?
 

Ashfaque

Student
Local time
Today, 18:03
Joined
Sep 6, 2004
Messages
894
Btns or textboxes will work at most of the places on the form except on chart itself. Neither we can get them on front of chart nor even make them visible or invisible if requires. They always go behind chart. My plan was just to place btns on bottom of each Bar and once clicked, it will show the actual percent of employees in this dept. in the unbound text box.

Anyway, thanks for your support.
 

isladogs

MVP / VIP
Local time
Today, 13:33
Joined
Jan 14, 2017
Messages
18,258
But as already mentioned, buttons can be placed alongside the chart ... I find that works well
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 07:33
Joined
Feb 28, 2001
Messages
27,320
Btns or textboxes will work at most of the places on the form except on chart itself. Neither we can get them on front of chart nor even make them visible or invisible if requires. They always go behind chart. My plan was just to place btns on bottom of each Bar and once clicked, it will show the actual percent of employees in this dept. in the unbound text box.

Anyway, thanks for your support.

See my answer (post #3 of this thread) regarding the .Controls collection. Since a "live" chart object does not have a .Controls collection, I would suggest this cannot be done without some kind of "cheating" - and offhand, I don't know how I would approach this. Access allows you to do SOME types of inheritance in user-defined structures - but Access-defined structures such as a Chart object cannot easily be augmented. Access itself doesn't have the ability to use foreign structures as though they were native structures. I.e. you cannot create a Chart object that also has a .Controls collection. Well, maybe you can... but Access won't use it that way because the CODE doesn't recognize the additions, and we don't get to see Access's internal code. It's a "black box" as far as we are concerned, and that means "no way in" to make changes of behavior.
 

Users who are viewing this thread

Top Bottom