User Defined Type Not Defined

JONeill

Board Regular
Joined
Sep 2, 2018
Messages
58
New to Access programming. Just created a form and wired events to it but every time I bring the form up on either the control or an event like Form_Load, I get a "User Defined Type Not Defined" error. I wired the control events through the property sheet and used the Code Builder option. I'm also testing the events through the interface using Form View.
 

Some videos you may like

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
54,486
Office Version
  1. 365
Platform
  1. Windows
Can you please post the VBA code behind it so we can see it?
 

JONeill

Board Regular
Joined
Sep 2, 2018
Messages
58
They are just stubs. What I did was to click on the control, and, on the property sheet under the Event tab, I clicked on the ellipse and chose Code Builder. It then created the stub. I get the error when I go into FormView. I can't even get to a breakpoint. It has to be some simple procedural thing I'm not doing.
 

JONeill

Board Regular
Joined
Sep 2, 2018
Messages
58
OK. I found it. Apparently there was an undefined object because the class module was not pulled into the project from the Excel project I was working on. The confusion was that the compiler did not flag it as it normally would (or at least in a way I'm used to) until I did a compile project from the Debug menu. I also had an error on an object who's class module is included in the project named currentRecord. I figure it must be a reserve word because when I changed the name, I got a clean compile.
 

Watch MrExcel Video

Forum statistics

Threads
1,109,331
Messages
5,528,053
Members
409,800
Latest member
camronmartin

This Week's Hot Topics

Top