User-defined type not defined

boerbende

Ben
Local time
Tomorrow, 00:58
Joined
Feb 10, 2013
Messages
339
Dear readers

I have a simple function top open multiple forms.
It works but it gives me an error on the first line when I try to compile my database
Compile error: User-defined type not defined
Dim frmInstance As New Frm_Myform
DoCmd.OpenForm frmInstance

What to do to avoid the compile error
I checked the tools / reference but do not know what to select

Many thanks

Ben
 
it will be the object Frm_Myform that is the problem.

try maybe

dim frmInstance as form
set frmInstance = New Frm_Myform

are you sure its frm_Myform, and not just myForm?
 
The root cause was more "banal" than I thought.
I renamed the form myself in the object pane a while ago. Yes it was frm_Myformv2 and I renamed it to frm_Myform without checking the VBA code of my project
 

Users who are viewing this thread

Back
Top Bottom