Speed is not enough of an issue to keep me from using it to address my issue.
However, from looking into the CallByName function, I don't see how to use
it to call a subroutine. I also failed to mention that the subroutine
contains an argument.
> You can use CallByName(), although even the MS developers warn that's a
> horribly slow method.
Tony Jollans - 23 Oct 2006 00:00 GMT
I wouldn't recommend this in this circumstance (what is wrong with a simple
Select Case statement?) but one relatively simple way to do it is ...
In ThisDocument put ...
Sub PreviewDocument1(Argument)
' Do whatever
End Sub
Sub PreviewDocument2(Argument)
' Do whatever
End Sub
' etc.
Wherever you want it, code
Callbyname ThisDocument, "PreviewDocument" & rs.fields("FormID"),
vbMethod, Parameter
--
Enjoy,
Tony
> Speed is not enough of an issue to keep me from using it to address my issue.
> However, from looking into the CallByName function, I don't see how to use
[quoted text clipped - 3 lines]
> > You can use CallByName(), although even the MS developers warn that's a
> > horribly slow method.