Disabling mouse wheel

G

Guest

Hello,
I visited Stephen Lebans site (http://www.lebans.com/mousewheelonoff.htm)
and downloaded his solution for disabling the mouse wheel in Access 2000. I
put it in the Load event of a form. However, when the form is loaded, I get
the following error ( braces {} my clip, brackets [] part of error message):

========begin error text=========

{DB Name}
The expression On Load that you entered as the event property setting
produced the following error: A problem occurred while {DB Name} was
communicating with the OLE server or ActiveX Control.
*The expression may not result in the name of a macro, the name of a
user-defined function, or [Event Procedure].
*There may have been an error evaluating the function, event, or macro.

=========end error text==========

If anyone has used this solution and has any ideas where the problem may
lie, I'd appreciate any info you have. I have tried having the DLL in both
my system folder and in the same folder as the mdb. I also moved the module
with the function definitions into the database, to no avail.

Thanks to all.
 
G

Guest

Yes, it works fine in his sample database. Unfortunately, I can't seem to
nail down what's different with mine. Whether I put the code on a button
click event, or a form load/unload event, I still get the same error (event
specific). I've tried putting a breakpoint on the first line of code, but it
doesn't get to that point, so it must be something happening during
compile(?). There's not an OLE server (the whole database is resident on my
machine), so I'm assuming that Access isn't recognizing the MouseWheelOn and
MouseWheelOff functions as functions. However, I've never done anything in
VBA before that relied on libraries, so I don't know that I could identify
the problem without being able to step through his code, which I can't seem
to be able to do.....

Thanks.
--
Mike Lee
McKinney,TX USA


Tom Wickerath said:
Hi Mike,

Did you download the sample database that Stephen makes available? Try that
one and see if you get a similar error. If that one works fine, then reverse
engineer it to see what he did differently.


Tom Wickerath
Microsoft Access MVP

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________

mikelee101 said:
Hello,
I visited Stephen Lebans site (http://www.lebans.com/mousewheelonoff.htm)
and downloaded his solution for disabling the mouse wheel in Access 2000. I
put it in the Load event of a form. However, when the form is loaded, I get
the following error ( braces {} my clip, brackets [] part of error message):

========begin error text=========

{DB Name}
The expression On Load that you entered as the event property setting
produced the following error: A problem occurred while {DB Name} was
communicating with the OLE server or ActiveX Control.
*The expression may not result in the name of a macro, the name of a
user-defined function, or [Event Procedure].
*There may have been an error evaluating the function, event, or macro.

=========end error text==========

If anyone has used this solution and has any ideas where the problem may
lie, I'd appreciate any info you have. I have tried having the DLL in both
my system folder and in the same folder as the mdb. I also moved the module
with the function definitions into the database, to no avail.

Thanks to all.
 
G

Guest

Tom,
I've tried a few more things, and managed to confuse myself even further,
but maybe it'll help shed some light.

First, I found this in the knowledge base:

http://support.microsoft.com/default.aspx/kb/907337/en-us

It says this error can be caused by creating a module in one non-unicode
language and trying to run it on a machine with a different non-unicode
language as the default. Based on Mr. Lebans' geography, I guessed he would
have been using English(Canada) and installed that on my machine. I now
still get the error when I click a button, but no longer get the error on the
form load/unload events. However, nothing appears to happen on the
load/unload events (I can't even make them display a messagebox).

I created macros which use RunCode to run the mousewheelon and mousewheeloff
functions. If I run those from the database window or the tools menu, they
work perferctly. However, if I try to use docmd.runmacro on a button click,
I still get the error. If I try to use docmd.runmacro on form load/unload,
nothing happens (no error, but no results either).

Sort of feel like I might be narrowing it down a little (maybe?) but still
can't crack the nut. If any of this gives you any ideas, I'd certainly
appreciate it.

Thanks again for the help.

BTW--Access 2000, Office 2003, XP Tablet Edition SP2 if I didn't already
mention that.

--
Mike Lee
McKinney,TX USA


Tom Wickerath said:
Hi Mike,

Did you download the sample database that Stephen makes available? Try that
one and see if you get a similar error. If that one works fine, then reverse
engineer it to see what he did differently.


Tom Wickerath
Microsoft Access MVP

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________

mikelee101 said:
Hello,
I visited Stephen Lebans site (http://www.lebans.com/mousewheelonoff.htm)
and downloaded his solution for disabling the mouse wheel in Access 2000. I
put it in the Load event of a form. However, when the form is loaded, I get
the following error ( braces {} my clip, brackets [] part of error message):

========begin error text=========

{DB Name}
The expression On Load that you entered as the event property setting
produced the following error: A problem occurred while {DB Name} was
communicating with the OLE server or ActiveX Control.
*The expression may not result in the name of a macro, the name of a
user-defined function, or [Event Procedure].
*There may have been an error evaluating the function, event, or macro.

=========end error text==========

If anyone has used this solution and has any ideas where the problem may
lie, I'd appreciate any info you have. I have tried having the DLL in both
my system folder and in the same folder as the mdb. I also moved the module
with the function definitions into the database, to no avail.

Thanks to all.
 
G

Guest

Hello Tom,
I tried one more thing, and it seemed to work. I opened a blank database
and imported all of the tables, queries, forms, macros and modules out of the
one that was giving me the error. Everything worked fine in the new
database.
Apparently it was something with that specific mdb, but I can't even begin
to guess what. It might be that the timing of it starting when I added
Stephen's code was just a coincidence (or, not a coincidence, but not related
to his code either).

Thanks again for all of the help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top