Strange VB Editor Behavior

P

Paul Fenton

Very often, when I'm operation in the Editor, here's what happens:

I type "If" then a space and the cursor jumps back one space to the
left, right after the "f".

I type "Me.(something)" and for an instant the list of properties pops
up then disappears and my text turns red.

I type the work MsgBox and then a space and the " mark, my cursor will
jump to the left, right after the 'x' in 'Msgbox' and 2 quote marks
appear as in "".

Sometimes closing everything and rebooting cures this, but it comes
back every time.

Does anybody know what's goin on?


Paul Fenton
(e-mail address removed)
 
K

Kevin K. Sullivan

This is a symptom of having a (visible or invisible) form open with a timer
event firing during development. Each timer event takes the focus off the
IDE, which activates the syntax checker, which removes spaces, ....

Copy the following line of code onto the clipboard. (You might need to
paste it into a text editor first and coerce it onto one line, depending on
your newsreader. It must be one line.)

For i = 0 to Forms.Count -1: Debug.Print Forms(i).Name,
Forms(i).TimerInterval: Next i

Switch to Access. Press Ctrl-G to go to the Immediate Window. Press Ctrl-V
to paste in the code. Press enter to to run the code. All open forms will
be listed. Any non-zero timer intervals are your culprits.

You can suspend the timers with
Forms("FormName").TimerInterval = 0

or simply
DoCmd.Close acForm, "FormName"
depending on the reasoning for the forms being open in development anyway.

Good luck!

Been there. Done this.

Kevin
 
M

Media Lint

This may be one explanation but I have encountered the
same thing (once) where that definitely was not the case
as I'm not keen on timers and there definitely wasn't one
involved at the time. I did the close, reboot and it
hasn't come back. I suspect that it was a conflict with
another application. Perhaps one that indeed was using an
event timer, though not the Access DB open at the time
(Access 2002 SP-1).
 
P

Paul Fenton

Kevin, thank you for the solution!

Yes, I do have a hidden form (frmDetectIdleTime) open in this
application where the timer's firing. It's designed to shut it down
if no input from the user in 30 minutes.

Paul Fenton
 

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