abjMouseWheel

D

David

Jack, You know it's funny but I tried what you suggested, importing etc.
Right as soon as I finished importing, it was then working. I could page up
and down with my records using my Mouse Wheel. I have only one Form in the
db.
Then, when I closed the db and then re-opened, it again no longer worked.
The form no longer recognized the mouse wheel for some odd reason.
What the heck is going on??? This is the same version of Access and Vista
that I was previously using. What is Access 12.0, is that A2007?
Any clue what's happening?--David
 
D

David

Gina,
To the best of my understanding, I open up, let's say the abjMouseWheel to
view its code in vba. I then go to Debug and then compile. I did that
although nothing appears to have occurred. I guess that meant that there
were no errors, right?
David
 
G

Gina Whipp

David,

Yes, it is and I forgot... Do you have...

Option Compare Database
Option Explicit

....at the top of every database? (And yes when nothing appears it is a good
thing.)

Also, do you have anything in the On_Close event of the form in question?

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 
D

David

I'm not sure what
"Option Compare Database
Option Explicit" are. I'm not sure what you mean by the "top. of every
database". I don't see those words anywhere near the top (or anywhere else
for that matter) in the database.

For the On_Close event, I found this:

Private Sub Form_Close()
DoCmd.Restore
End Sub

This was part of the Form code.

David
 
J

Jack Leach

These should be in the top of each Module. Open your code window and each
module you click on these two lines should be the first uncommented lines.

Option Compare Database tells your code how to compare strings, numbers, etc.
Option Explicit tells your code that each variable needs to be defined for
it to be used. This is very important... make sure they're at the top of
each module (commented code (in green, something like: 'commented code) can
go before these, or empty spaces, but nothing else.

--
Jack Leach
www.tristatemachine.com

"I haven''t failed, I''ve found ten thousand ways that don''t work."
-Thomas Edison (1847-1931)
 
D

David

Alright, I read up on this and I see what they are.
All of the modules that I have, each have a Compare Option at the top. And
none of the Modules have the Option Explicit. So I went to Options under
Tools and noticed that the "Require Variable Declaration" was UNCHECKED. So
I checked it. Now, how do I further correct this error?
David
 
J

Jack Leach

This means that any new modules created will have it in there, but you will
need to go through to all of your existing modules and add it.

After you do this, compile the code, and if you get any errors along the
lines of "Compile Error - Variable Not Defined", this means that there is in
fact an issue (usually a misspelled variable name or something of the sort).

I would recommend adding it to one module, compile, fix errors, move to the
next module, compile, fix errors, etc. If there is declaration issues this
will make it a little easier to handle.

--
Jack Leach
www.tristatemachine.com

"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)
 
D

David

Ok, I went ahead and added the Option Explicit and compliled. NO ERRORS.
I am extremely suspicious about these modules. Again, when I initially
imported to a new db, everything functions correctly and when I close it and
re-op the imported db, none of the funtions in the Forms code are working,
NONE OF THEM. Really strange!
David
 
G

Gina Whipp

David,

Something is wrong and I do not belive it is the modules as I tested it and
it works for me. So, I have a thought... does the database have any data?
I would like to take a look at it, for FREE and see what gives.

OR

Maybe Jack has a few new tricks, because I am all out.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 
D

David

Gina, Thank you very much. The db does have data in it. It is not huge,
about 10 mb.
And it is not sensitive data! If you tell me how to strip out the data, I
will.
David
 
J

Jack Leach

Maybe Jack has a few new tricks, because I am all out.

I was holding off hoping you would have this one :)

David, my next idea would be to have you post the code so we can take a look
at it. I have no idea what the code is you're working with, so if you post
it maybe myself or someone else may be able to pick something out.

I don't run A2k7 else I'd offer to take a copy as well. Posting code here
is usually a good thing as everyone can see it. What one (or two or three)
people miss often is plainly apparent to someone else.

--
Jack Leach
www.tristatemachine.com

"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)
 
D

David

Sure, here it is:

Option Compare Database
Option Explicit

Public Function MakeCurrency(ctl As Control)
'Purpose: Divide by 100 if not decimal point.

If InStr(ctl.Text, ".") = 0 Then
ctl = ctl / 100
End If
End Function

Private Sub Form_Close()
DoCmd.Restore
End Sub

Private Sub Form_Current()
DoCmd.Maximize
End Sub
Private Sub cmdDatePostedUpdateForm_Click()
On Error GoTo Err_cmdDatePostedUpdateForm_Click

Dim stDocName As String

stDocName = "DateUpdateQuery"
DoCmd.OpenQuery stDocName, acNormal, acEdit

Exit_cmdDatePostedUpdateForm_Click:
Exit Sub

Err_cmdDatePostedUpdateForm_Click:
MsgBox Err.Description
Resume Exit_cmdDatePostedUpdateForm_Click

End Sub
Private Sub UpdateQuery_fromToday__Click()
On Error GoTo Err_UpdateQuery_fromToday__Click

Dim stDocName As String

stDocName = "DateUpdateQuery(fromToday)"
DoCmd.OpenQuery stDocName, acNormal, acEdit

Exit_UpdateQuery_fromToday__Click:
Exit Sub

Err_UpdateQuery_fromToday__Click:
MsgBox Err.Description
Resume Exit_UpdateQuery_fromToday__Click

End Sub
Private Sub Update_Click()
On Error GoTo Err_Update_Click

Dim stDocName As String

stDocName = "DateUpdateQuery"
DoCmd.OpenQuery stDocName, acNormal, acEdit

Exit_Update_Click:
Exit Sub

Err_Update_Click:
MsgBox Err.Description
Resume Exit_Update_Click

End Sub

Private Sub Form_MouseWheel(ByVal Page As Boolean, ByVal Count As Long)
Call DoMouseWheel(Me, Count)
End Sub


Private Sub UpdateQuery_Click()
On Error GoTo Err_UpdateQuery_Click

Dim stDocName As String

stDocName = "DateUpdateQuery(fromToday)"
DoCmd.OpenQuery stDocName, acNormal, acEdit

Exit_UpdateQuery_Click:
Exit Sub

Err_UpdateQuery_Click:
MsgBox Err.Description
Resume Exit_UpdateQuery_Click

End Sub
 
G

Gina Whipp

David,

Okay, I have the database and I have opened and closed this thing upteen
times by closing the whole thing down and just closing the form and I am
still able to scroll thru the records using the mouse wheel. I am not sure
what else to. This module does exactly what it is suppose to.

I looked at the modules, David you forgot to check the module behing the
forms which were lacking the *Option Explicit*. No worries there because
that turned up no errors either! No issues with your coding either.

I would also want to make sure all updates have been installed.

I have also noted a few things that you probably want to look into... I
included those things in the eMail and databse I just eMailed back.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 

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