Pierre Beauchamp
New member
- Local time
- Today, 01:22
- Joined
- Jul 22, 2010
- Messages
- 6
This is a part of the script from Treeview activeX that I have.
Every node in the scrip work fine. My problem I want to see the report call by ( DoCmd.OpenReport reportname:=strObjectName) to be seen in preview mode not to print directly.
I try several combinaison with AcViewpreview with no success. I think the problem is with the way the report is called (reportname:=strObjectName)
Private Sub tvSB_NodeClick(ByVal node As Object)
'User clicked a node
Dim strSwitchboard_SubForm_ToShow As String
Dim strForm_OpenArgs As String
strSwitchboard_SubForm_ToShow = mconMainForm
mstrFormArgs = ""
If UBound(Split(node.KEY, ";")) = 3 Then
Dim strObjectType As String
Dim strObjectName As String
Dim strObjectAddtnl As String
strObjectType = Split(node.KEY, ";")(1)
strObjectName = Split(node.KEY, ";")(2)
strObjectAddtnl = Split(node.KEY, ";")(3)
On Error Resume Next
Select Case strObjectType
Case "Form"
strSwitchboard_SubForm_ToShow = strObjectName
mstrFormArgs = strObjectAddtnl
Case "Form_Dialog"
DoCmd.OpenForm FormName:=strObjectName, windowmode:=acDialog, OpenArgs:=strObjectAddtnl
Case "Report"
DoCmd.OpenReport reportname:=strObjectName
Case "Code"
CallByName CodeContextObject, strObjectName, VbMethod, strObjectAddtnl
Every node in the scrip work fine. My problem I want to see the report call by ( DoCmd.OpenReport reportname:=strObjectName) to be seen in preview mode not to print directly.
I try several combinaison with AcViewpreview with no success. I think the problem is with the way the report is called (reportname:=strObjectName)
Private Sub tvSB_NodeClick(ByVal node As Object)
'User clicked a node
Dim strSwitchboard_SubForm_ToShow As String
Dim strForm_OpenArgs As String
strSwitchboard_SubForm_ToShow = mconMainForm
mstrFormArgs = ""
If UBound(Split(node.KEY, ";")) = 3 Then
Dim strObjectType As String
Dim strObjectName As String
Dim strObjectAddtnl As String
strObjectType = Split(node.KEY, ";")(1)
strObjectName = Split(node.KEY, ";")(2)
strObjectAddtnl = Split(node.KEY, ";")(3)
On Error Resume Next
Select Case strObjectType
Case "Form"
strSwitchboard_SubForm_ToShow = strObjectName
mstrFormArgs = strObjectAddtnl
Case "Form_Dialog"
DoCmd.OpenForm FormName:=strObjectName, windowmode:=acDialog, OpenArgs:=strObjectAddtnl
Case "Report"
DoCmd.OpenReport reportname:=strObjectName
Case "Code"
CallByName CodeContextObject, strObjectName, VbMethod, strObjectAddtnl