Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error when using Immediate window-recent happening 2

Status
Not open for further replies.

VicM

Programmer
Sep 24, 2001
443
US
Hi,
I'm using Access 2010(32-bit) on a Win 7 Pro box. Been using this a number of years and never had this problem before; or any problem I couldn't resolve in Access or Excel.
I went to the immediate window and typed =currentdb.version. At first when I typed the period, the context menu popped up but immediately disappeared. If it disappeared before I typed the v, it didn't complete the word "version". So I completed the word and hit enter. I then received the dreaded error msg: Compile error: Expected line number or label or statement or end of statement.
This happened time and time again (what did someone say?: Doing the same thing over and over and expecting a different result is the definition of insanity. LOL)
Anyway, I compacted and repaired the DB; same result. So I rebooted the PC. Again, same result.
One other thing that's happened: If I tried creating a new subroutine in a Module, when I typed the word "Sub", then hit space to give it a name, the cursor immediately went back to after the "b" in Sub turning the word Sub red and effectively removing the space I had typed. If I then type a name immediately after the "b" in Sub I can then move the cursor between Sub and the name and then I'm able to enter a space, at which time the parens are added after the name and also the "End Sub" line.
Can anyone suggest a course of action? I'm scratching my head on this one.
Thanks,
Vic
 
In immediate window, '?' instead of '=':
[tt]? CurrentDb.Version[/tt]
or
[tt]? Application.CurrentDb.Version[/tt]

Subroutine problem,try:
- check if there are no missing references
- in VBE options set 'break on all errors' and compile the project.

combo
 
Thanks combo.

I was definitely having a brain cramp with that one. Of course it's a ? not =. Doh!!
However, the rest of the problems I mentioned are still in existence.

Thanks again,
Vic (DOH!!)
 
Vic,
The symptoms you provided typically occur when there is a form open that has code in the Timer event.

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
 
Duane,
Thanks for your input.

OMG!! I do have one Timer event on the open Form. I was totally unaware of this issue due to a Timer event. When I close the Form or put it in design mode all those aforementioned issues disappear.

Just goes to show you can teach an OLD dog new tricks!!

Thanks a bunch Duane,
Vic
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top