From within a form module, I am calling a public function attempting to pass a Form or Subform object.
Unfortunately, I continue to get a “Type mismatch” error when calling the function.
Calling function within Form module:
Public Function declaration within separate module:
…
I’ve tried various iterations of declaring the function:
'Public Function ChangeHeight(By Ref SubFormObj As Access.Navigati onControl.SubFo rm)
Type mismatch when compiling
Public Function ChangeHeight(Su bFormObj As Access.SubForm)
Public Function ChangeHeight(Su bFormObj As SubForm)
Public Function ChangeHeight(Su bFormObj As Object)
Gets into object but then can’t use its properties
I’ve also tried various iterations of calling the function:
ChangeHeight (Me!Subform_gro upNames)
ChangeHeight (Me.Subform_gro upNames)
Produces: "Type mismatch - #13"
I’ve tried this:
BUT this causes a memory leak in Access. When the Access application shuts down, an Access process remains resident as a running process.
I’ve changed the parameter to “Form” but that also throws the "Type mismatch - #13" error.
Unfortunately, I continue to get a “Type mismatch” error when calling the function.
Calling function within Form module:
Code:
Debug.Print TypeName(Me.Subform_groupNames) 'Prints out: “SubForm” ChangeHeight (Me.Subform_groupNames) 'Type mismatch #13”
Code:
Public Function ChangeHeight(SubFormObj As Access.SubForm)
I’ve tried various iterations of declaring the function:
'Public Function ChangeHeight(By Ref SubFormObj As Access.Navigati onControl.SubFo rm)
Type mismatch when compiling
Public Function ChangeHeight(Su bFormObj As Access.SubForm)
Public Function ChangeHeight(Su bFormObj As SubForm)
Public Function ChangeHeight(Su bFormObj As Object)
Gets into object but then can’t use its properties
I’ve also tried various iterations of calling the function:
ChangeHeight (Me!Subform_gro upNames)
ChangeHeight (Me.Subform_gro upNames)
Produces: "Type mismatch - #13"
I’ve tried this:
Code:
ChangeHeight (Forms!Main_Form.Subform_groupNames)
I’ve changed the parameter to “Form” but that also throws the "Type mismatch - #13" error.
Comment