Disable events in Access

  • Thread starter Thread starter Frans
  • Start date Start date
F

Frans

Hi there,

Does Access have a VBA-command like e.g. Excels
Application.EnableEvents = False?

Thanks in advance, Frans
 
Like Dirk, I'm not aware of any such command either.

Perhaps if you explained why you were looking for it, we could suggest an
alternative.
 
Like Dirk, I'm not aware of any such command either.

Perhaps if you explained why you were looking for it, we could suggest an
alternative.

--
Doug Steele, Microsoft Access MVPhttp://I.Am/DougSteele
(no private e-mails, please)








- Tekst uit oorspronkelijk bericht weergeven -

Hi Doug,

Thanks for the attention.

I'd like to detect MouseMove-events just once and then temporarely
switch of
the detection. I only know of EnableEvents = False for all Excel
events.

Complex alternative would be to make the event remark-out its own code
lines in the module. Didn't try this yet.

Frans
 
Self-modifying code is probably not a good idea.

Can you not just set a global variable the first time the code fires (or,
better yet, write a value to a table or to the form), and bypass the code if
it's already been run?
 
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, _
X As Single, Y As Single)

Static dtTheTime As Date

'If more than 10 seconds have elapsed since last mouse move
If DateDiff("s", dtTheTime, Time()) > 10 Then
'Do stuff
dtTheTime = Time()
Else
'do Nothing or do something else
End If

End Sub

John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
 
Good idea, John, assuming the OP wants the mouse reactivated after a period.
I wasn't thinking along those lines: I thought that once the first mouse
move was detected, they didn't want it active again.
 
Self-modifying code is probably not a good idea.

Can you not just set a global variable the first time the code fires (or,
better yet, write a value to a table or to the form), and bypass the code if
it's already been run?

--
Doug Steele, Microsoft Access MVPhttp://I.Am/DougSteele
(no e-mails, please!)











- Tekst uit oorspronkelijk bericht weergeven -

Hi Doug,

The global variable-suggestion worked.

Thanks for advice, Frans
 

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

Back
Top