I'm trying to pass an ActiveX user document
object to a sub routine, but I get a Type mismatch error 13. The following
are code examples:
This sub routine is defined on the
UserDocments:
__________________________________________________________________
Private Sub UserDocument_Show()
' I have tried three
methods
' Method 1
Dim MyDoc as
UserDocument
Set MyDoc = Me ' This
produces a type mismatch
EnableDisable MyDoc,
False
' Or Method 2
EnableDisable UserDocument,
False ' Produces Type mismatch
' Or Method 3
EnableDisable Me, False
' Produces Type mismatch
End Sub
__________________________________________________________________
Routine defined in global module or enable or
disable all controls on the UserDocument:
__________________________________________________________________
Public Sub EnableDisable (ThisDoc as
UserDocument, bEnable as Boolean)
Dim DocControl as
Control
For each DocControl in
ThisDoc
DocControl.Enable = bEnable
Next
End Sub
__________________________________________________________________
Is this even possible? Or am I not understanding
something about the UserDocument object