Im trying to pass a report to a function. If I define the argument as being CRAXDRT.Report none of the objects I have on my form are referenced anymore. Using Variant or Object does not work either. I can't actually use the name of the report either. Here's what I want to do:
VB Code:
  1. Private Sub OneSub (param as Integer)
  2.  
  3. Dim InvM1 as MyCRReport1
  4. Dim InvM2 as MyCRReport2
  5. Dim InvM3 as MyCRReport3
  6.  
  7. Select Case param
  8. Case 0
  9. Call MyFunction(InvM1)
  10. Case 2
  11. Call MyFunction(InvM2)
  12. Case 3
  13. Call MyFunction(InvM3)
  14. End Select
  15. End Sub
  16.  
  17. Public Function MyFunction(InvMReport As ??)
  18.  
  19. End Function

Any idea?