Using User-defined Types Within Procedures

Question:
This is a beginner’s question but in a smalldatabase application when I click on a commandbutton the code gives me the error message “Invalid Inside procedure” and highlights the Type statement. The Type statement and the four lines of code including the End Type line seem finematching book and Microsoft help file examples.Any ideas?

Answer:
The problem is the placement of the Type declaration. All Type declarations need to be in the declarations section of the form or the code module. They can’t be defined within a procedure, as you apparently have done. Once you move the type declaration, there won’t be any real change to your code, but it will work fine.Eric

Share the Post:
Share on facebook
Share on twitter
Share on linkedin

Overview

Recent Articles: