为什么 Ms Access 在切换到正确的记录之前会短时间显示第一条记录? [英] Why does Ms Access show the first record for a short time before switching to the right one?

查看:62
本文介绍了为什么 Ms Access 在切换到正确的记录之前会短时间显示第一条记录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要重现执行此步骤.您只需要视觉设计师.

To reproduce do this steps. You only need the visual designer.

  1. 创建一个简单的表:(ID,txt)
  2. 插入一些测试记录
  3. 创建一个表单并将该表用作数据源
  4. 插入 ID、txt 控件
  5. 插入列表框并选择选项 3:表单必须显示在列表框中选择的记录

现在选择第一个记录以外的记录.你必须仔细观察.在显示所选记录之前,表单会在很短的时间内显示表格的第一条记录.

Now select a record other than the first one. You have to watch carefully. The form displays the tables first record for a very short time, before the choosen record is displayed.

  1. 为什么?
  2. 我该如何阻止?

提示:为了更好地看到这个效果,请使用一个大的 txt 控件,并在第一条记录中设置XXXXXXXXXXX".

Hint: For better see this effect, use a large txt control with "XXXXXXXXXXX" set in the first record.

推荐答案

我猜你已经创建了一个宏.不要,在列表框的 AfterUpdate 事件中使用代码:

I guess you have created a macro. Don't, use code in the AfterUpdate event of the listbox:

' Set filter.
Me.Filter = "[ID] = " & Nz(Me!NameOfYourListBox.Value, 0) & ""
' Activate filter.
Me.FilterOn = True

这篇关于为什么 Ms Access 在切换到正确的记录之前会短时间显示第一条记录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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