在编辑新记录时,DataGrid中的上一行看起来像是空的 [英] Previous row in a DataGrid looks like being empty while editing a new record

查看:85
本文介绍了在编辑新记录时,DataGrid中的上一行看起来像是空的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

***症状***

我将在此处描述的方案正在运行适当地使用MS Office 2010,但它与MS Office 2016没有相应的b $ b。简单地说,我在主窗体中使用子窗体。使用MS Office 2010,此子表单
按预期工作,包括通过子表单添加新记录的功能。不幸的是,在MS Office 2016中,
我面临一个严重的可视化问题。当我添加新记录时,我看到在数据网格末尾添加了一个新的空行。
。到现在为止还挺好。我在第一个字段输入一个值,然后按下TAB键。

光标放在新行的下一个字段中,但上一行突然变空。事实上,目前没有删除数据

,但之前的记录似乎是空的。这让用户感到困惑,这让他们感到紧张,因为之前的记录似乎因为添加了新记录而丢失了。

The scenario that I am going to describe here is working properly with MS Office 2010, but it does not
with MS Office 2016. Simply put, I am using a subform within the main form. With MS Office 2010, this subform
works as expected, including ability to add a new record via the subform. Unfortunately, in MS Office 2016
I am facing one serious visualization issue. When I add a new record, I see a new empty line added
at the end of a data grid. So far, so good. I enter a value to the first field and I am pressing the TAB key.
Cursor is placed to the next field of the new row, but the previous line above is suddenly empty. In fact, no data
has been deleted at the moment, but the previous record seems to be empty. It is confusing for users and it makes them nervous as it looks like the previous record has been lost because of addition of a new record.

***实施细节***

子窗体将其Recordset属性定义为ADODB记录集,如以下代码摘录所示:



****** ************************************************** ************************
Dim rstAdoData As ADODB.Recordset



...
$


[将rstAdoData记录集带回这里填充数据的一些逻辑]



...
$


设置mfrmForm.Controls(strSfrmControlName).Form.Recordset = rstAdoData

******** ************************************************** *********************



更准确地说,对于ADODB Connection的以下属性和ADOD B RecordSet

我使用的是其他值而不是默认值:



**************** ************************************************** *************

mconAdoConnection.Properties("Jet OLEDB:ODBC Parsing")= -1

rstAdoData.MaxRecords = 10000

rstAdoData.CacheSize = 10000

***************************** **************************************************

提前感谢您提供任何解决方案或提示...

*** Implementation details ***
The subform has defined its Recordset property as an ADODB recordset like the following excerpt from code depicts:

*******************************************************************************
Dim rstAdoData As ADODB.Recordset

...

[some logic that brings the rstAdoData recordset back here filled with data]

...

Set mfrmForm.Controls(strSfrmControlName).Form.Recordset = rstAdoData
*******************************************************************************

Just to be more precise, for the following properties of ADODB Connection and ADODB RecordSet
I am using another values than defaults:

*******************************************************************************
mconAdoConnection.Properties("Jet OLEDB:ODBC Parsing") = -1
rstAdoData.MaxRecords = 10000
rstAdoData.CacheSize = 10000
*******************************************************************************
Thank you in advance for any solution or hint...

推荐答案

> ;>>不幸的是,在MS Office 2016中,
我面临一个严重的可视化问题。当我添加新记录时,我看到在数据网格末尾添加了一个新的空行。
。到现在为止还挺好。我在第一个字段输入一个值,然后按下TAB键。

光标放在新行的下一个字段中,但上一行突然变空。<<< ; b


根据您的描述,我已经制作了一个没有任何VBA代码的示例来测试Access 2016中的这个问题,遗憾的是,我无法做到。因此,我建议您检查表中是否有空记录或调试您的VBA代码。 
$


此外,您可以压缩/修复您的数据库,然后确保可以复制此问题。



感谢您的理解。
>>>Unfortunately, in MS Office 2016
I am facing one serious visualization issue. When I add a new record, I see a new empty line added
at the end of a data grid. So far, so good. I enter a value to the first field and I am pressing the TAB key.
Cursor is placed to the next field of the new row, but the previous line above is suddenly empty.<<<

According to your description, I have made a sample without any VBA code to test this issue in Access 2016, unfortunately, I am not able. So I suggest that you could check whether there is an empty record in table or debug your VBA code. 

In addition you could compact/repair your database, then make sure that this issue can be reproduced.

Thanks for your understanding.


这篇关于在编辑新记录时,DataGrid中的上一行看起来像是空的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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