tuxDPenguin
09-15-2006, 02:02 PM
This is fixed, so pay no attention, I couldn't figure out how to change the topic though. :)
Let me preface this with I'm not an Access or VB developer, so this might be simple, but despite that I am stuck with this assignment and i've googled till i'm blue in the face. :confused:
i'm just converting an access 97 program to 2003, in 97 this code runs silently with no problem, in 2003 a window pops up, i'm trying to get rid of that window.
this code:
subrptName is a string
rptChart is a report
ctlReport is a control
subrptName = "sub_rpt_Charts"
DoCmd.OpenReport subrptName, acViewDesign
x = 0
Set rptChart = Reports(subrptName)
For Each ctl In rptChart.Controls
ctlArray(x, 1) = ctl.Name
If ctl.ControlType = acBoundObjectFrame Then
ctlArray(x, 2) = True
Else
ctlArray(x, 2) = False
End If
x = x + 1
Next ctl
x = x - 1
For y = 0 To x
If ctlArray(y, 2) = True Then
DeleteReportControl rptChart.Name, ctlArray(y, 1)
End If
Next y
If chk_RunChart = True Then
chart1 = "RunChart"
If chk_Histogram = True Then
chart2 = "Histogram"
Else
chart2 = "StdDev"
End If
Else
chart1 = "Histogram"
chart2 = "StdDev"
End If
Set ctlReport = CreateReportControl(subrptName, acBoundObjectFrame, acDetail _
, , , 0, 300, 4560, 2340)
ctlReport.ControlSource = chart1
ctlReport.SizeMode = acOLESizeStretch
Set ctlReport = CreateReportControl(subrptName, acBoundObjectFrame, acDetail _
, , , 4620, 300, 4560, 2340)
ctlReport.ControlSource = chart2
ctlReport.SizeMode = acOLESizeStretch
If frme_Chart = 1 Then
rptChart.GroupLevel(0).ControlSource = "Product"
rptChart.GroupLevel(1).ControlSource = "Spec"
Else
rptChart.GroupLevel(1).ControlSource = "Product"
rptChart.GroupLevel(0).ControlSource = "Spec"
End If
Reports(subrptName).Filter = _
"([Product] " & strProd & ") AND ([Spec] " & strSpec & ")"
Reports(subrptName).FilterOn = True
DoCmd.SetWarnings False
DoCmd.Close acReport, subrptName, acSaveYes
DoCmd.SetWarnings True
on that second to last line, DoCmd.Close, pops up this window:
please and thank you! :D
Let me preface this with I'm not an Access or VB developer, so this might be simple, but despite that I am stuck with this assignment and i've googled till i'm blue in the face. :confused:
i'm just converting an access 97 program to 2003, in 97 this code runs silently with no problem, in 2003 a window pops up, i'm trying to get rid of that window.
this code:
subrptName is a string
rptChart is a report
ctlReport is a control
subrptName = "sub_rpt_Charts"
DoCmd.OpenReport subrptName, acViewDesign
x = 0
Set rptChart = Reports(subrptName)
For Each ctl In rptChart.Controls
ctlArray(x, 1) = ctl.Name
If ctl.ControlType = acBoundObjectFrame Then
ctlArray(x, 2) = True
Else
ctlArray(x, 2) = False
End If
x = x + 1
Next ctl
x = x - 1
For y = 0 To x
If ctlArray(y, 2) = True Then
DeleteReportControl rptChart.Name, ctlArray(y, 1)
End If
Next y
If chk_RunChart = True Then
chart1 = "RunChart"
If chk_Histogram = True Then
chart2 = "Histogram"
Else
chart2 = "StdDev"
End If
Else
chart1 = "Histogram"
chart2 = "StdDev"
End If
Set ctlReport = CreateReportControl(subrptName, acBoundObjectFrame, acDetail _
, , , 0, 300, 4560, 2340)
ctlReport.ControlSource = chart1
ctlReport.SizeMode = acOLESizeStretch
Set ctlReport = CreateReportControl(subrptName, acBoundObjectFrame, acDetail _
, , , 4620, 300, 4560, 2340)
ctlReport.ControlSource = chart2
ctlReport.SizeMode = acOLESizeStretch
If frme_Chart = 1 Then
rptChart.GroupLevel(0).ControlSource = "Product"
rptChart.GroupLevel(1).ControlSource = "Spec"
Else
rptChart.GroupLevel(1).ControlSource = "Product"
rptChart.GroupLevel(0).ControlSource = "Spec"
End If
Reports(subrptName).Filter = _
"([Product] " & strProd & ") AND ([Spec] " & strSpec & ")"
Reports(subrptName).FilterOn = True
DoCmd.SetWarnings False
DoCmd.Close acReport, subrptName, acSaveYes
DoCmd.SetWarnings True
on that second to last line, DoCmd.Close, pops up this window:
please and thank you! :D