Immediate window

rotorque

Registered User.
Local time
Today, 18:37
Joined
Dec 17, 2008
Messages
53
I am still finding my way around Access 2002 (slowly). I've discovered the immediate window. I assume that any code typed in here, assuming the syntax is correct, will work.

Can anyone explain why when I typed:

? 1+1 (and enter) I got the right answer without any problem.

BUT when I typed:

x=msgbox ("Cold potatoes aren't hot!") (enter) I got a message telling me that my sytax was wrong. I then quit not saving anything and then reloaded the database and retyped the message and the box displayed the message.

I seem to have compilation errors regularly, with code I have been given by the good people of this forum. Is there a setting that I need to look at or anything else? Any thoughts?

Ro
 
I just tried the same thing myself and it worked okay (though I will say it is a odd thing to test- I generally would just do each evaluation piecewise in immediate windows but I digress)

That leads me to believe there is either missing references or corruption...

1) To check for missing references - Tools -> References. You should see if any ticked checkboxes have "MISSING:....". Clear it then compile it again.

2) If corrupted, create new blank database, turn off AutoCorrect then import in everything from your old database and try again.
 
I agree very odd but I am getting very frustrated with the compilation errors.

Thanks for the guidance I have looked in the References area and Only the following are checked:
Visual Basic For Applications
Microsoft Access 10.0 Object Library
OLE Automation
Microsoft ActiveX Data Objects 2.5 Library
Mirosoft Office XP Web Components

I don't know if this is correct or not at this stage. Is there anything that should be checked that is not?

I haven't found where the auto correct option yet will try this.

Many thanks
 

Users who are viewing this thread

Back
Top Bottom