如果表单属性“记录集类型”,表单将仅显示数据。设置为快照 [英] Form will only display data if the form property "Record set type" is set to Snapshot

查看:66
本文介绍了如果表单属性“记录集类型”,表单将仅显示数据。设置为快照的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个表单来编辑员工数据,该表单是添加员工表单的副本(效果很好),顶部有一个列表框,用于选择要编辑的员工,以便导航到正确的记录。 />

我使用列表框向导创建列表框并选择记录。问题是它只有在我将表单设置为快照时才有效,因此我无法编辑数据。


如果我有快照袖珍,它将正确导航并显示正确的数据记录集类型。如果我使用Dyanset它显示列表框。但我的表格上没有别的。


我做错了什么?


这里是表格的代码,如果有帮助的话。 />

I have a form to edit employee data that is a copy of the add employee form ( Which works great) with a list box at the top to select the employee to edit that is susposed to navigate to the correct record.

I am using the list box wizard to create the listbox and select the record. The problem is that it only works if i set the form to snapshot so I then can not edit the data.

It will navigate correctly and display the correct data if I have Snapshot sleected at the Record set type. If I have use "Dyanset" it displays the listbox. but nothing else on my form.

What am I doing wrong?

here is the code for the form if it helps.

展开 | 选择 | Wrap | 行号

推荐答案

表单所基于的记录集是什么样的?


我也想知道你为什么用 Dim rs As Object 来声明记录集而不是 Dim rs As Recordset 组合框的AfterUpdate过程。我不知道这会有什么不同,但这只是我注意到的事情。


Pat
What does the recordset that the form is based upon look like?

I''m also wondering why you use Dim rs As Object to declare the recordset rather than Dim rs As Recordset in the AfterUpdate procedure for the combo box. I don''t know that this would make any difference, but it''s just something I noticed.

Pat


Dim rs当我使用向导创建列表框并告诉它根据所做的选择选择表中的记录时,对象来自acccess。它是自动生成的代码。记录集如下。

ID - 自动编号

姓氏 - 文字

名字 - 文字

组织 - 文字

工作电话 - 文字

家庭电话 - 文字

全名 - 文字

有效 - 是/否
The Dim rs as Object came from acccess when I created the list box with the wizard and told it to select the record in the table based on the selection made. It''s auto generated code. the record set is as follows.
ID - AutoNumber
LastName - Text
FirstName - Text
Organization - Text
Work Phone - Text
Home phone - Text
Full name - Text
Active - Yes/No

我只是尝试改为Dim rs As Recordset而没有运气。结果相同。如果表单属性中的记录集类型属性设置为除快照之外的任何内容,则不会填充任何数据。
I just tried Changing to Dim rs As Recordset with no luck. Same results. No data is populated if recordset type property in the form properties is set to anything but Snapshot.


这篇关于如果表单属性“记录集类型”,表单将仅显示数据。设置为快照的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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