SetFocus在Access窗体中不起作用 [英] SetFocus does not work in Access form

查看:376
本文介绍了SetFocus在Access窗体中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在表单上有一个未绑定的字段。在onClick事件中,我有代码来填充文本字段。我首先将焦点设置为它并启用它。这两项行动都有效。但是当我的代码到达我将textfieldname.text设置为值的行时,我得到一个错误:除非控件具有焦点,否则你不能引用属性或方法。


我的代码是:

I have an unbound field on a form. In the onClick event I have code to populate a text field. I first setFocus to it and enable it. Both of these actions work. But when my code reaches the the line whete I set the textfieldname.text to a value, I get an error: You can`t reference a property or method unless the control has focus.

My code is:

展开 | 选择 | Wrap | 行号

推荐答案

您是否可以使用Value属性?您也尝试过语法Me!txtFileName.SetFocus。我没有做太多的访问,所以那些可能不起作用,但我们确实有这些类型的问题的特定论坛部分,所以主持人可能会在那里移动这个主题。
Are you able to use the Value property instead? Also have you tried the syntax Me!txtFileName.SetFocus. I haven''t done much with access so those might not work, but we do have a specific forum section for these types of questions so a moderator will probably move this topic over there.


@ Veeves
@Veeves
展开 | 选择 | Wrap | 行号


我检查了帮助文件&我不明白为什么那样行不通。


这种情况​​在所有情况下都会发生吗?也许还有其他事情我们不知道。
I checked the help file & I can''t see why that wouldn''t work.

Does this happen in all circumstances? perhaps there''s something else going on we don''t know about.


这篇关于SetFocus在Access窗体中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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