devxlogo

Using User-defined Types Within Procedures

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

See also  Why ChatGPT Is So Important Today
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist