VBA Deleting Spaces As I type them

XelaIrodavlas

Registered User.
Local time
Today, 15:03
Joined
Oct 26, 2012
Messages
175
Hi All,

I've encountered a strange feature of Access VBA, which while isn't critical, is very annoying.

So I'm typing in the code window for a form (doesn't matter what form, report, macro, or if its real code or just 'notes), but Access is deleting the spaces I type almost as soon as I type them.

I've encountered similar before, and many people have found it's due to an on-timer event running, forcing the compiler to check everything and cut off any excess spaces. See similar post:
http://stackoverflow.com/questions/10900005/why-is-my-vba-for-ms-access-buggy

But I have checked and double checked, the form has no on Timer events and timer interval is set to 0. I closed all other windows to be certain, and have also checked its subforms and those are clear as well.

So my question, is there another reason why the compiler would be running every fraction of a second? I know I can work around it but it's really annoying!

Thanks all :)
 
Never seen that before, could you post a stripped down version, zip it?
 
Hi JHB,

No problem, I was going to attach the whole thing since its a draft project anyway, but the file size was too big...

I've left the aforementioned components in and the issue remains.

Any ideas? :)
 

Attachments

... Ok wait a second, I downloaded my own attachment and it seems to be working fine...

The only thing that changed was after deleting all the other objects I ran a compact and repair, which must have removed the issue.

I'm going to run through the other objects a chunk at a time and see what I can come up with...

:S
 
Okay - then I'll wait, no need for downloading your database then.
Else create a new database and import all into it, maybe that helps.
 
Gotcha you little ...!

I was calling the fOSUserName Function On the HomePage to detect the current user (Intention was to monitor users logging on/off, as well as presenting a little 'welcome back InsertNameHere!')

You can see it on the attachment I provided, but for some reason its not always an issue. If you open the attached and try switching the homepage from Design view to form view a few times, hopefully you will see what I mean.

In any case, I can solve this by using the Forms Onload event and set the control values to the Username upon load. This way it wont feel the need to refresh all the time.

Thanks for the assist JHB I was going a bit nuts with this :)

Edit: Since it may be relevant, I am working with MS Access 2013.
 
But I have checked and double checked, the form has no on Timer events and timer interval is set to 0

Sorry, but I got lost in the complex explanation of what you tried and didn't try...my fault...not enough coffee this morning!

But just to be clear...the Timer doesn't have to be running on the errant Form; i.e. a Timer running on FormX can interfere with writing code on FormA or FormB or FormC, etc.

Linq ;0)>
 

Users who are viewing this thread

Back
Top Bottom