2003 Database won't compile

M

Mike B

I am having trouble compiling my Access 2003 database when I use a module
that prevents the mouse wheel from advancing the records in a data input
form. The problem with using the mouse wheel is that there is no way to
stop the mouse wheel from advancing beyond the last record in the database
and thus causing an uncontrolled entrance into a new record.



I found a procedure on the internet that prevents the mouse wheel from
scrolling through the records but still allows the wheel to scroll in list
and combo boxes. This procedure included a tiny database to demonstrate the
controlled mouse wheel. The procedure consists of a module to access a
'MouseHook.dll' file (not an ActiveX control) which is placed in the same
folder as your database or the System32 folder. There are also a couple of
functions in the module which are called from the Form Load and Form Close
events of my 'Data Input Form' to turn the mouse wheel on and off.



The demonstration program compiles without a hitch. When I transfer the
module and coding into my database it controls the mouse wheel perfectly,
but when I try to compile the database code it gives me a Visual Basic error
message of "User-defined type not defined". No coding is highlighted to
indicate what the message refers to.



My database compiles without error without this module and coding added. I
have compared the references list in both databases and they are the same,
and are listed in the same order. My database does contain an extra
reference to the Common Dialog Control 6.0 but is at the bottom of the
reference list. It cannot be a misspelling as the code for the module was
copied and pasted into my database module. I have checked and rechecked the
spelling of the function calls in the Form Load and Form Close event
procedures.



I have been battling this for over a month. Any ideas on what is happening?
 
E

ErezM via AccessMonster.com

hi
first, if you dont use the common dialog control6 then by all means have it
removed, then try compiling again
now, about scrolling past the last record (and into a new one), if all you
want is prevent that, then set the form's Allow Additions property to false,
and your users will never slide over to the new record
if you still need to add new records, you can use a button "Add Record" or
somethng that will set the above property back to True (but remember to set
it to false in the AfterInsert event)

good luck
 

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