重新计算表单会导致未绑定的组合框重新查询 [英] Recalcing form causes unbound combo box to requery

查看:68
本文介绍了重新计算表单会导致未绑定的组合框重新查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在尝试创建一个连续体表单,允许用户编辑每个项目的各个字段。不幸的是,我需要的数据分布在多个表中,因此将控件绑定到基础查询中的项会阻止我编辑它。为了解决这个问题,我已经将控件绑定到从数组返回数据的函数,类似于 http://www.thescripts.com/forum/thread193301.html


当用户尝试编辑控件中的值时,我将新值存储在数组中,然后在表单上调用Recalc来更新控件。这一直很好,但是,我现在已经在表单中添加了一些组合框来过滤呈现给用户的记录。组合框基于查询并且是未绑定的,但是现在当调用recalc时,它似乎在组合框上启动重新查询,在用户的更改进入屏幕之前导致恼人的间隙。有没有办法阻止组合框重新查询(除了使它们成为值列表)?我正在使用Access 2003.


或者,我可以重新查询单个控件以避免组合框受到影响。然而,这导致其他行中的相应控件闪烁。 (他们的价值暂时消失,然后重新出现)。有没有办法隐藏这个更新的影响(我一直试图为表单打开/关闭绘画,没有运气)?

Hi,
I''m attempting to create a continuos form which allow the user to edit various fields for each item. Unfortunately, the data I need is spread over multiple tables so binding the control to the item in the underlying query prevents me from editing it. To get round this I''ve bound the controls to functions returning the data from an array, similar to the method described in http://www.thescripts.com/forum/thread193301.html.

When the user trys to edit the value in the control, I store the new value in the array and then call Recalc on the form to update the control. This has been working fine, however, I have now added some combo boxes to the form to filter the records presented to the user. The combo boxes are based on queries and are unbound, but now when recalc is called, it appears to initiate a requery on the combo boxes, causing an irritating gap before the user''s changes make it to the screen. Is there a way to prevent the combo boxes from requerying (aside from making them value lists)? I''m using Access 2003.

Alternatively, I can requery the individual control to avoid the combo boxes being affected. This however causes the corresponding controls in the other rows to "flicker" (their values disappear momentarily, then reappear). Is there a way to hide the affects of this update (I''ve been trying to turn painting on/off for the form, with no luck)?

推荐答案




我正在尝试创建一个连续体表单,允许用户编辑每个项目的各个字段。不幸的是,我需要的数据分布在多个表中,因此将控件绑定到基础查询中的项会阻止我编辑它。为了解决这个问题,我已经将控件绑定到从数组返回数据的函数,类似于 http://www.thescripts.com/forum/thread193301.html


当用户尝试编辑控件中的值时,我将新值存储在数组中,然后在表单上调用Recalc来更新控件。这一直很好,但是,我现在已经在表单中添加了一些组合框来过滤呈现给用户的记录。组合框基于查询并且是未绑定的,但是现在当调用recalc时,它似乎在组合框上启动重新查询,在用户的更改进入屏幕之前导致恼人的间隙。有没有办法阻止组合框重新查询(除了使它们成为值列表)?我正在使用Access 2003.


或者,我可以重新查询单个控件以避免组合框受到影响。然而,这导致其他行中的相应控件闪烁。 (他们的价值暂时消失,然后重新出现)。有没有办法隐藏这个更新的影响(我一直在尝试为表单打开/关闭绘画,没有运气)?
Hi,
I''m attempting to create a continuos form which allow the user to edit various fields for each item. Unfortunately, the data I need is spread over multiple tables so binding the control to the item in the underlying query prevents me from editing it. To get round this I''ve bound the controls to functions returning the data from an array, similar to the method described in http://www.thescripts.com/forum/thread193301.html.

When the user trys to edit the value in the control, I store the new value in the array and then call Recalc on the form to update the control. This has been working fine, however, I have now added some combo boxes to the form to filter the records presented to the user. The combo boxes are based on queries and are unbound, but now when recalc is called, it appears to initiate a requery on the combo boxes, causing an irritating gap before the user''s changes make it to the screen. Is there a way to prevent the combo boxes from requerying (aside from making them value lists)? I''m using Access 2003.

Alternatively, I can requery the individual control to avoid the combo boxes being affected. This however causes the corresponding controls in the other rows to "flicker" (their values disappear momentarily, then reappear). Is there a way to hide the affects of this update (I''ve been trying to turn painting on/off for the form, with no luck)?



以下是一些以渐进方式尝试的事情。如果他们中的任何一个有帮助,请告诉我们:


1.当你进行重新计算时,只需将重新计算限制为要更改的控件>假设recalc更新主窗体上的总数以更改子窗体总数>>>>>>> Me.Parent!ControlName.Recalc

1 A.确保recalc命令是在正确的事件中执行proc>>>>如果您在子窗体页脚中重新调整主窗体的更改,则可能应该从子窗体的afterUpdate事件发出recalc命令

2.如果那不起作用,请尝试Me.Parent!ControlName.Refresh

3.尝试在屏幕上绘制关闭/打开命令之间将recalc夹在中间

4.尝试还打开/关闭屏幕绘画之间的重新查询命令

Here are a few things to try in a progressive fashion. Let me know if any of them help:

1. when you do the recalc, just limit the recalc to the control that is to be changed> assuming recalc is to update a total on the main form for changes on the subform total>>>>>>Me.Parent!ControlName.Recalc
1A.Make sure recalc command is being executed in the correct event proc>>>>if you are recalcing the Main form for changes in the subform footer, the recalc command should probably be issued from the afterUpdate event of the subform
2. If that doesn''t work try Me.Parent!ControlName.Refresh
3. try sandwiching the recalc above between screen painting off/on commands
4. try also sandwiching the requery commands betwen screen painting on/off


在单独控件上调用Recalc将是理想的解决方案,但是我只使用了Access的版本它适用于表格。


我已经设法通过在控件上运行Requery之前关闭绘画来解决闪烁问题,然后再调用Repaint(简单地再次打开画面仍然会产生闪烁)。干杯。
Calling Recalc on the individual control would''ve been the ideal solution, but the version of Access I''m working with only supports it for Forms.

I''ve managed to solve the flickering issue by turning painting off before running Requery on the control, and then calling Repaint afterwards (simply turning painting on again still produced flickering). Cheers.



在单独的控件上调用Recalc将是理想的解决方案,但Access的版本我正在工作只支持表单。


我已经设法通过在控件上运行Requery之前关闭绘画来解决闪烁问题,然后再调用Repaint(简单地再次打开画面仍然会产生闪烁)。干杯。
Calling Recalc on the individual control would''ve been the ideal solution, but the version of Access I''m working with only supports it for Forms.

I''ve managed to solve the flickering issue by turning painting off before running Requery on the control, and then calling Repaint afterwards (simply turning painting on again still produced flickering). Cheers.



很高兴您的问题得到解决。感谢关于绘画与重画的信息...这是我不知道的事情。回复:访问版本不允许重复个人控制.... AFAIK从1997年开始的每个版本都有它。它不适合你的可能原因是你没有使用正确的语法(需要完全限定的引用)。


Glad your problem is resolved. Thanks for the info about painting vs repainting...that is something I did not know. Re: Access version not allowing recalc on individual control....AFAIK every version from 1997 and on has it. The probable reason it did not work for you is that you did not use the correct syntax (fully qualified reference is required).


这篇关于重新计算表单会导致未绑定的组合框重新查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆