By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,098 Members | 1,950 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,098 IT Pros & Developers. It's quick & easy.

EVERY "on open" gives "expected end of statement" error-->SOLUTION!

P: n/a

Wanted to share a solution to something which I didn't find on the net:

EVERY form in my Microsoft Access 2002 database gave an error any time any
code was to be called: form OnOpen, button OnClick, etc.

Error was: <b>The expression On Open you entered as the event property
setting produced the following error: Expecteed: end of statement.</b> [Where
"On Open" could be replaced by "On Click", etc]

The problem ultimately was the letter "s" had gotten at the beginning of my
module code so that it read: <b>sOption Compare Database</b>...

Deleting the "s" fixed it! :)

Happy coding,
Aaron
Nov 13 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a

Sorry, thought <b> would work...don't see how to edit the post...if an admin
wants to delete those to make it more readable it would be fine.

A
Nov 13 '05 #2

P: n/a
Aaron G via AccessMonster.com wrote:
Sorry, thought <b> would work...don't see how to edit the post...if an admin
wants to delete those to make it more readable it would be fine.


Nope - AM sends your posts to usenet where plain text is traditional.
You'd have to couple the "<b>" with a "</b>", ie, html stuff. 8)

Thanks for the info on how the option compare statement can mess things
up if incorrectly entered! It's one of those things the intellisense
doesn't pick up as an error, I guess.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "What's UP, Dittoooooo?" - Ditto
Nov 13 '05 #3

P: n/a
I just pasted this in access97

sOption Compare Database

and the line turned red indicating an error
and 'compiling' the module gave me the same error you got

sounds like good solutions to me

Nov 13 '05 #4

P: n/a
Tim Marshall <TI****@PurplePandaChasers.Moertherium> wrote in
news:dc**********@coranto.ucs.mun.ca:
Thanks for the info on how the option compare statement can mess
things up if incorrectly entered! It's one of those things the
intellisense doesn't pick up as an error, I guess.


Excuse, but don't you all regularly compile your modules? And your
databases as a whole? That would clearly throw an error as soon as
you tried to compile a module with such invalid code in it.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #5

P: n/a
David W. Fenton wrote:
Tim Marshall <TI****@PurplePandaChasers.Moertherium> wrote in Excuse, but don't you all regularly compile your modules? And your
databases as a whole? That would clearly throw an error as soon as
you tried to compile a module with such invalid code in it.


Yes, I quite a bit don't worry. I was just trying to be positive for
the fellow since he was obviously confused about what usenet is, I've
never seen him post before. I didn't want to appear to be lecturing,
but perhaps I went too soft wrt what future googling by newbies might
reveal...
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "What's UP, Dittoooooo?" - Ditto
Nov 13 '05 #6

P: n/a
Tim Marshall wrote:
Yes, I quite a bit don't worry.


Er, I do, sorry.

Anyway, I don't know what I was thinking when I wrote my response to
Aaron G and really managed to let some of my boneheadedness I thought I
was doing a good job of hiding slip out like an accidental fart at a
quiet party!!!

8)
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "What's UP, Dittoooooo?" - Ditto
Nov 13 '05 #7

P: n/a
Tim Marshall <TI****@PurplePandaChasers.Moertherium> wrote in
news:dc**********@coranto.ucs.mun.ca:
Tim Marshall wrote:
Yes, I quite a bit don't worry.


Er, I do, sorry.

Anyway, I don't know what I was thinking when I wrote my response
to Aaron G and really managed to let some of my boneheadedness I
thought I was doing a good job of hiding slip out like an
accidental fart at a quiet party!!!


As opposed to an intentional fart?

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.