设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

返回列表 发新帖
查看: 1252|回复: 2
打印 上一主题 下一主题

[Access本身] [原创]一个有关对象引用的问题.

[复制链接]
跳转到指定楼层
1#
发表于 2004-8-27 18:03:00 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
如下:

private sub form_open(cancel as integer)

     me.filter="名称='车床'"

     me.filteron=true

end sub

该例中的"me" 应该是个对象引象,可我不知道它是怎么来的.有没有相关定义.
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享分享 分享淘帖 订阅订阅
2#
发表于 2004-8-27 18:57:00 | 只看该作者
You can use the Me property in Visual Basic to refer to a form, report, (or to the form or report associated with a subform or subreport), or class module where Visual Basic code is currently running.SettingThe Me property is available only by using Visual Basic and is read-only in all views. RemarksThe Me property contains an object reference to the current form or report and is faster than a fully qualified object reference. For example, the following two code fragments refer to the value of the LastName control for the current record on the Employees form:strLastName = Forms!Employees.LastNamestrLastName = Me!LastNameIn most cases, the form or report referred to by the Me property is the same form or report referred to by the ActiveForm or ActiveReport properties of the Screen object. However, these properties refer to the form or report with the focus, whereas the Me property always refers to the form or report in which code is running. For example, a

Timer event can occur in a form that doesn't have the focus. When that happens, the code Screen.ActiveForm refers to the form with the focus, and the Me property refers to the form in which the Timer event occurred. Therefore, when you are creating generic procedures that operate on the current form, the preferred method is to pass the form to the procedure by using the Me property rather than the ActiveForm property.You can use the Me keyword in class modules to refer to the current instance of that class. Just as you use Me in form or report class modules to retrieve a reference to the current form or report, you use Me in a class module to retrieve a reference to the current class module object.
3#
发表于 2004-8-27 22:49:00 | 只看该作者
me不就是当前窗体吗?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|站长邮箱|小黑屋|手机版|Office中国/Access中国 ( 粤ICP备10043721号-1 )  

GMT+8, 2024-10-6 22:28 , Processed in 0.105157 second(s), 27 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表