KB Q278379 ActiveX DLL method wont work on a Form with a subform 
Author Message
 KB Q278379 ActiveX DLL method wont work on a Form with a subform

Hi,

I tried using the ActiveX DLL method of the KB Q278379 it works fine
with just one form but if a form is with a subform, it doesnt work
perfectly.

I have a form with a subform, i placed all the codes needed at both
forms, the main form and the subform
because both forms (main form and subform) needs to cancel the
MouseWheel event.

I noticed that everything works okay at the Main Form, but once you go
to the subform,
you CANNOT click on any text boxes anymore, the blinking _ underscore
would not show,
you cannot tab through to get to them. this all happens at the
subform.

Despite this, the code still works on both main form and subform
the mousewheel event was captured, message box prompting
user that mousewheel is not available.

I wonder if anyone had experienced such a thing?
If yes, how did you resolve it? (A main form and subform, both needs
MouseWheel Event cancel)

example

Main Form--------------------------------------------------------
                    combo box
                    text box
                    text box
Sub Form -------------------------------------------------------
                    text box
                    text box
-----------------------------------------------------------------------

Thanks so much,
Any insights to this problem will be surely appreciated.

Henry Wu



Sat, 19 Feb 2005 09:19:13 GMT  
 KB Q278379 ActiveX DLL method wont work on a Form with a subform
Sorry Henry, the solution does not work for SubForms.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


Quote:
> Hi,

> I tried using the ActiveX DLL method of the KB Q278379 it works fine
> with just one form but if a form is with a subform, it doesnt work
> perfectly.

> I have a form with a subform, i placed all the codes needed at both
> forms, the main form and the subform
> because both forms (main form and subform) needs to cancel the
> MouseWheel event.

> I noticed that everything works okay at the Main Form, but once you go
> to the subform,
> you CANNOT click on any text boxes anymore, the blinking _ underscore
> would not show,
> you cannot tab through to get to them. this all happens at the
> subform.

> Despite this, the code still works on both main form and subform
> the mousewheel event was captured, message box prompting
> user that mousewheel is not available.

> I wonder if anyone had experienced such a thing?
> If yes, how did you resolve it? (A main form and subform, both needs
> MouseWheel Event cancel)

> example

> Main Form--------------------------------------------------------
>                     combo box
>                     text box
>                     text box
> Sub Form -------------------------------------------------------
>                     text box
>                     text box
> ----------------------------------------------------------------------
-

> Thanks so much,
> Any insights to this problem will be surely appreciated.

> Henry Wu



Sat, 19 Feb 2005 09:35:26 GMT  
 KB Q278379 ActiveX DLL method wont work on a Form with a subform
Hi Stephen, i just wanted to inform you that Mr. Peter Walker has a workaround
for this.

I guess the trick here is not to Hook two MouseWheel at the same time
or Access quits immidiately when one closes the main form.

Henry

---------------------------------------------------------------------------
Private WithEvents clsMouseWheel1 As MouseWheel.CMouseWheel
Private WithEvents clsMouseWheel2 As MouseWheel.CMouseWheel

Private Sub Form_Load()
    Set clsMouseWheel1 = New MouseWheel.CMouseWheel
    Set clsMouseWheel1.Form = Me.Form
    clsMouseWheel1.SubClassHookForm

    Set clsMouseWheel2 = New MouseWheel.CMouseWheel
    Set clsMouseWheel2.Form = Me.subSRPDealer.Form
End Sub

Private Sub Form_Close()
   clsMouseWheel1.SubClassUnHookForm
   Set clsMouseWheel1.Form = Nothing
   Set clsMouseWheel1 = Nothing

   clsMouseWheel2.SubClassUnHookForm
   Set clsMouseWheel2.Form = Nothing
   Set clsMouseWheel2 = Nothing
End Sub

Private Sub subSRPDealer_Enter()
    clsMouseWheel1.SubClassUnHookForm
    clsMouseWheel2.SubClassHookForm
End Sub

Private Sub subSRPDealer_Exit(Cancel As Integer)
    clsMouseWheel2.SubClassUnHookForm
    clsMouseWheel1.SubClassHookForm
End Sub

Private Sub clsMouseWheel1_MouseWheel(Cancel As Integer)
    MsgBox "You cannot use the mouse wheel at this form"
    Cancel = True
End Sub

Private Sub clsMouseWheel2_MouseWheel(Cancel As Integer)
    MsgBox "You cannot use the mouse wheel at this form"
    Cancel = True
End Sub
---------------------------------------------------------------------------

Quote:

> Sorry Henry, the solution does not work for SubForms.

> --

> HTH
> Stephen Lebans
> http://www.lebans.com
> Access Code, Tips and Tricks
> Please respond only to the newsgroups so everyone can benefit.



> > Hi,

> > I tried using the ActiveX DLL method of the KB Q278379 it works fine
> > with just one form but if a form is with a subform, it doesnt work
> > perfectly.

> > I have a form with a subform, i placed all the codes needed at both
> > forms, the main form and the subform
> > because both forms (main form and subform) needs to cancel the
> > MouseWheel event.

> > I noticed that everything works okay at the Main Form, but once you go
> > to the subform,
> > you CANNOT click on any text boxes anymore, the blinking _ underscore
> > would not show,
> > you cannot tab through to get to them. this all happens at the
> > subform.

> > Despite this, the code still works on both main form and subform
> > the mousewheel event was captured, message box prompting
> > user that mousewheel is not available.

> > I wonder if anyone had experienced such a thing?
> > If yes, how did you resolve it? (A main form and subform, both needs
> > MouseWheel Event cancel)

> > example

> > Main Form--------------------------------------------------------
> >                     combo box
> >                     text box
> >                     text box
> > Sub Form -------------------------------------------------------
> >                     text box
> >                     text box
> > ----------------------------------------------------------------------
>  -

> > Thanks so much,
> > Any insights to this problem will be surely appreciated.

> > Henry Wu



Tue, 22 Feb 2005 23:33:05 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Why DCOM ActiveX Exe is Working and ActiveX Dll is not working

2. Why is that some ActiveX objects wont work in Notes

3. VB5 ActiveX control wont work on VB4(32bit)

4. VB 6.0 DLL wont work in IIS 5.0?

5. ActiveX dll wont unload after being called in iis 4.0

6. some ActiveX DLLs wont register in Access

7. DSum works in form but not in subform

8. Form and subform don't work.

9. navigating for keyboard users - subfrom to form - subform to subform

10. changing the sourceobject of subform when the form and subform are loaded

11. ActiveX Control - Line Method won't work in VBScript

12. ActiveX DLL events won't fire when DLL shows Modal Form

 

 
Powered by phpBB® Forum Software