简体   繁体   English

MS Access 2003/2007-子窗体上的图表对象,父窗体加载时不加载

[英]MS Access 2003/2007 - Chart Object on a sub form, not loading when parent forms load

SO I have a subform, that simply has one chart object on it. 所以我有一个子窗体,上面只是一个图表对象。 Its small, and this is the only purpose of this sub. 它很小,这是此子程序的唯一目的。 Then I have about 10 forms that each have a sub windows with this form as it's child. 然后,我有大约10个表单,每个表单都有一个子窗口,该窗口是它的子窗口。 I use a UNION query to show the current balance of 10 accounts on each form with this chart for comparative purposes. 为了进行比较,我使用UNION查询在此表格上显示每个表格上10个帐户的当前余额。 Everything works fine except for one small thing... 除了一件小事,一切都正常。

when you open any of these forms, you have to take your mouse over to the actual sub window and click inside of it to get the chart to show. 当您打开任何这些窗体时,都必须将鼠标移到实际的子窗口上,然后在其中单击以显示图表。 once you do it works fine, on any and all forms, but this same issue if recurring on all these forms as well, so I am sure I am missing something here?? 一旦您这样做,它就可以在任何形式和所有形式上正常工作,但是如果在所有这些形式上都同样发生此问题,那么我确定我在这里遗漏了一些东西吗?

Any ideas about this one? 关于这个有什么想法吗?

thanks Justin 谢谢贾斯汀

I think you can work this out by not using a subform, but rather a chart control directly inserted in the form. 我认为您可以通过使用子窗体来解决此问题,而是直接在窗体中插入图表控件。 I know it can be a headache to design a chart control in every form, but by doing it, you can control directly the data source of the chart independently from any other form. 我知道以每种形式设计图表控件可能会让人头疼,但是通过这样做,您可以独立于任何其他形式直接控制图表的数据源。

Example: 例:

I will suppose that you need to update the chart after updating a text box (txtExample). 我假设您需要在更新文本框(txtExample)之后更新图表。 You can alter the data source of the control usint the afterUpdate event: 您可以使用afterUpdate事件来更改控件的数据源:

Private Sub txtExample_AfterUpdate()
  chart1.RowSource = "SELECT ... FROM ..." 
  chart1.Requery
End Sub

The RowSource property of the chart object will be altered and updated every time the value of the text box is updated. 每次更新文本框的值时,图表对象的RowSource属性都会更改和更新。

Hope this works for you 希望这对你有用

I have looked around for this problem and found that me.graph1.requery doesn't help in my 2003 version. 我到处寻找这个问题,发现me.graph1.requery在我的2003版本中无济于事。 I did try in desperation this: docmd.requery (Graph1) that crashes but when you put on error resume next it does show the graph everytime! 我确实在无奈docmd.requery (Graph1)尝试了此操作:崩溃的docmd.requery (Graph1) ,但是当您放下on error resume next它每次都会显示图! True Microsoft style I guess to fix it with another buggy thing. 真正的Microsoft风格,我想用另一个有问题的东西来修复它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 MS Access 2007/2003-从父窗体引用子窗体上的控件 - MS Access 2007/2003 - Referencing a control on a sub form, from the parent form MS Access 2007将表单转换为子表单-“找不到表单”问题 - MS Access 2007 Converting forms into sub form - “form not found” issue MS Access 2003/2007-子窗体作为控制面板,用全局引用关闭父窗体吗? - MS Access 2003/2007 - Subform as control panel, closing parent form with global like reference? MS ACCESS 2007-当所有其他表单都为全屏显示时,将小弹出表单变为非全屏显示 - MS ACCESS 2007 - Making a small pop form not full screen, when all other forms are full screen MS Access 2003/2007-通过未绑定表单和隐藏文本框上的变量传递数据 - MS Access 2003/2007 - Passing data through a variable on unbound forms vs. a hidden text box 如何在MS Access 2003中打开MS Access 2007文件 - how to open ms access 2007 file in ms access 2003 ms Access:加载表单时如何在表单中显示不可见对象? - ms access: how to display the invisible object in form when load the form? MS Access 2003/2007-在装有2007 Office的桌面上编译2003版本mdb; 不会保留2003 MDE? - MS Access 2003/2007 - Compiling 2003 version mdb on desktop with 2007 Office installed; will not retain 2003 mde? 连续表格(ms Access 2003) - Continuous Form (ms Access 2003) MS Access 2003 ADP报告图表 - Chart on MS Access 2003 ADP report
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM