Unable to add spaces in VBA code? Why???

SpiritedAway

Registered User.
Local time
Today, 02:38
Joined
Sep 17, 2009
Messages
97
:mad: Following good database practise I recently compacted my database - the next day I went into my database to write some VBA code and it will not allow me to add any spaces between words, whenever i hit the spacebar and try to write some code it joins the word up to the last word.

Does anyone know why this is happening and what I can do about it!!!

Thanks

SpiritedAway
 
Maybe you have a timer running. Whenever code needs to run Access compiles the file. During compilation trailing spaces are removed from the source so if the timer interval is short then trailing spaces might be removed faster than you can type them.
 
Thanks for posting a reply lagbolt

At present a simple piece of code such as

If IsNull([LastName]) Then
AddyLineVar = [Company]
SalutationVar = "Sir or Madam"

end up looking like

IfIsNull([LastName])Then
AddyLineVar=[Company]
SalutationVar="SirorMadam"

If it is as you say, is there anyway I can stop this from happening?
 
Do you happen to use multiple versions of Access? I've noticed sometimes if I've used 97 and then move onto 2003, it does a similar thing?! Maybe?!
 
Hi Mattkorguk

The only versions of Access on my machine is 2007 - it all started to happen once I had compacted my database.

Since then it has affected my ability to use the spacebar when writing code, it drags the word back and joins it to the proceeding word.

I'm now using a back-up copy of the database and code-writing is absolutely fine - I only get the same problem in the back-up database if I cut n' past any tables, forms, code, from the original one. Then all of a sudden the spacing in VBA goes all screwy!!

This was the first time I used the compact option - thought it would be good for my database but it has utterly messed up my ability to write any damn code!!

If you have any thoughts on the problems - any suggestions or advice is more than welcomed.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom