John Spencer said:
AHA! You probably have a form open that has the timer event that is active.
So when the timer event is triggered, the form event grabs the focus. When
the module you are entering into loses the focus, Access reacts as if you have
clicked out of the module window and you get the behavior you have described.
Just to follow up on this. I only set the timer event when the user
is running with an MDE. Which is what I always distribute.
Public Function IsMDE() As Boolean
Dim db As DAO.Database
On Error GoTo tagError
Set db = CurrentDb
If db.Properties("MDE") = "T" Then
IsMDE = True
End If
tagNoProperty:
db.Close: Set db = Nothing
On Error GoTo 0
Exit Function
tagError:
Select Case Err.Number
Case 3270 ' Property not found
IsMDE = False
Resume tagNoProperty
Case Else
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in
procedure IsMDE."
End Select
Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog -
http://msmvps.com/blogs/access/