If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Access > Invalid outside procedure error

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old
Registered User
 
Join Date: May 2003
Posts: 32
Invalid outside procedure error

I inadvertently deleted some vb code and now I am getting a compile error that states: "Invalid outside procedure". This error is showing up in the Option Compare Database Statement. I am new to the vb world and do not understand what this means. Any ideas on how I can fix this problem?
Reply With Quote
  #2 (permalink)  
Old
Registered User
 
Join Date: Jul 2003
Location: Frankfurt, Germany
Posts: 20
Re: Invalid outside procedure error

hi salky

this error usually appears when the compiler encounters some code that is supposed to be INSIDE a procedure
for example the statement
"exit sub"
cannot stand outside a "sub ... end" sub block because then there would be no sub to exit from, right?

so what obviously happened by deleting code is, that now you got some code left, which is missing itīs beginning "sub..." statement

good luck
cr

ps:
if u delete code accidently more often, itīs probably a good idea to export your libraries ifrom the project explorer from time to time ;-)
Reply With Quote
  #3 (permalink)  
Old
Registered User
 
Join Date: May 2003
Posts: 32
Re: Invalid outside procedure error

thank you for your help, cr. Your advice put me in the right direction to fix this issue.

Quote:
Originally posted by citizen.ron
hi salky

this error usually appears when the compiler encounters some code that is supposed to be INSIDE a procedure
for example the statement
"exit sub"
cannot stand outside a "sub ... end" sub block because then there would be no sub to exit from, right?

so what obviously happened by deleting code is, that now you got some code left, which is missing itīs beginning "sub..." statement

good luck
cr

ps:
if u delete code accidently more often, itīs probably a good idea to export your libraries ifrom the project explorer from time to time ;-)
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On