[AccessD] Problem implementing checkbox control class module

Bill Benson bensonforums at gmail.com
Wed Aug 26 09:57:56 CDT 2015


SOLVED... needed to assign Event Procedure to the OnClick property  [hate
that]...

Private Sub LoadReportTabs()
Set gColcolCk = New Collection
Set Myck = New clsck
Set Myck.ck = ckUseThis
Myck.ck.OnClick = "[Event Procedure]"
gColcolCk.Add Myck

On Wed, Aug 26, 2015 at 10:37 AM, Bill Benson <bensonforums at gmail.com>
wrote:

> At form load, I am running the below routine.
>
> Myck is dimensioned at the form module level. I don't even think it shold
> matter whether I do that or dim it at the procedure level, but it has been
> making no difference.
>
> The click event in my class module where I have dimmed ck publicly
> withevents is not firing.
>
> I am using a collection to hold the Myck.ck; I would think keeping that in
> memory by scoping it to the form module is enough - but even declaring it
> publicly has not helped me synch the class module with the control being
> clicked.
>
> Help?
>
> 'Standard Module
> Public gColcolCk As Collection
> 'Form Module
> Dim Myck As clsck
>
> Private Sub LoadReportTabs()
>     Set gColcolCk = New Collection
>     Set Myck = New clsck
>     Set Myck.ck = ckUseThis
>     gColcolCk.Add Myck
> End Sub
> 'Class clsCk
> Option Compare Database
> Option Explicit
> Public WithEvents ck As CheckBox
> Private Sub Ck_Click()
>     msgbox "Clicked"
> End Sub
>


More information about the AccessD mailing list