您作为事件属性设置输入的表达式更新后产生以下错误:对象或类不支持事件集 [英] The expression After Update you entered as the event property setting produced the following error: Object or class does not support the set of events

查看:164
本文介绍了您作为事件属性设置输入的表达式更新后产生以下错误:对象或类不支持事件集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Access版本2007上收到上述错误。 版本2003工作正常 - 更新后事件具有查找特定记录的代码。




私人子cmbFindClient_AfterUpdate()

    '找到与控件匹配的记录。

    Dim rs As Object



   设置rs = Me.Recordset.Clone

    rs.FindFirst"[CL-PK Client ID] =" &安培; Str(Nz(Me![cmbFindClient],0))

   如果不是rs.NoMatch那么Me.Bookmark = rs.Bookmark

结束Sub



为了其他人的利益,请将帖子标记为已回答或有帮助当他们回答或帮助您找到答案时。 ___"我们这样来探索月球,最重要的是我们发现了地球。" - 比尔·安德斯,
阿波罗8号。

解决方案

ciao SuzyQ,


I认为你应该应用recordsetClone属性而不是克隆方法。


尝试这种方式:


Private Sub cmbFindClient_AfterUpdate()<如果Len(Me!cboImp& vbNullString)> 0然后


  
使用Me.RecordsetClone


&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; .FindFirst" [CL-PK客户端ID] = " &安培;我! cmbFindClient


       
如果不是.NoMatch然后


           
Me.Bookmark = .Bookmark


       
结束如果


   
结束


end if if



结束子 


我假设  CL-PK客户端ID字段是数字而非文本。


HTH。


Ciao,Sandro。




I'm getting the error above on Access version 2007.  Version 2003 works fine - the after update event has code to find a particular record.


Private Sub cmbFindClient_AfterUpdate()
    ' Find the record that matches the control.
    Dim rs As Object

    Set rs = Me.Recordset.Clone
    rs.FindFirst "[CL-PK Client ID] = " & Str(Nz(Me![cmbFindClient], 0))
    If Not rs.NoMatch Then Me.Bookmark = rs.Bookmark
End Sub


For the benefit of others, please mark posts as answered or helpful when they answer or assist you in finding the answer. ___ "We came all this way to explore the Moon, and the most important thing is that we discovered the Earth." - Bill Anders, Apollo 8.

解决方案

ciao SuzyQ,

I think you should apply recordsetClone property and not clone method.

try this way :

Private Sub cmbFindClient_AfterUpdate()

If Len(Me!cboImp & vbNullString) > 0 Then

   With Me.RecordsetClone

        .FindFirst "[CL-PK Client ID]=" & Me!cmbFindClient

        If Not .NoMatch Then

            Me.Bookmark = .Bookmark

        End If

    End With

end if

End Sub 

I assumed CL-PK Client ID field is numeric and not text.

HTH.

Ciao, Sandro.



这篇关于您作为事件属性设置输入的表达式更新后产生以下错误:对象或类不支持事件集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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