将mainform和子表单绑定到SQL-server-view [英] Binding mainform and subforms to SQL-server-view

查看:62
本文介绍了将mainform和子表单绑定到SQL-server-view的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Access 2007中,我有一个包含多个子表单的主表单。所有表单都是未绑定的,表单的记录集是在主表单中的OnOpen事件期间设置的。


我使用ADO和OleDB连接到SQL服务器并且将记录集与表单绑定。


表单第一次打开时,一切正常。


在主窗体中,我有一个组合,根据所选值重置所有表单的记录集。当我这样做时,主窗体中的记录集会改变,但所有子窗体都会关闭,因此无法设置其记录集属性。子表单没有链接到主表单。


我花了几天时间试图解决这个问题,如果能有所帮助,我会发布一些代码。 />

问候

Jon Ole

解决方案

我有兴趣看到设置的代码子表单的记录源。在我期望的ComboBox的AfterUpdate事件中。



我有兴趣看到设置记录源的代码子窗体。在ComboBox的AfterUpdate事件中,我期待。



我已将代码放在组合中的click事件中:

展开 | 选择 | Wrap | 行号


我不是在忽视这一点。我今天有很多让我忙碌的事情。


我希望以后能够继续使用它,但如果你在明天之前再也没有看到它,请随意**碰撞它。

In Access 2007 I have a main form with several subforms. All forms are unbound, and the recordsets for the forms are set during the OnOpen-event in the main-form.

I use ADO and OleDB to connect to the SQL-server and to bind the recordsets with the forms.

Everything works OK when the forms open the first time.

In the main form I have a combo that resets the recordsets for all the forms depending on the selected value. When I do this, the recordset in the main form changes ok, but all the subforms are getting closed, so it''s impossible to set their recordset-property. The subforms are not linked to the main form.

I have spent a couple of days trying to solve this, I''ll post some of my code if that can help.

Regards
Jon Ole

解决方案

I''d be interested in seeing the code that sets the Record Sources for the subforms. In the AfterUpdate event of the ComboBox I expect.


I''d be interested in seeing the code that sets the Record Sources for the subforms. In the AfterUpdate event of the ComboBox I expect.

I''ve placed the code on the click-event in the combo:

Expand|Select|Wrap|Line Numbers


I''m not ignoring this. I just had lots to keep me busy today.

I hope to get on to it later, but if you see nothing more before tomorrow please feel free to **Bump** it.


这篇关于将mainform和子表单绑定到SQL-server-view的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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