Hi,

I have a CRViewer control in an array on an SSTab control with 4 tabs - each tab has a CRViewer. I have 4 predesigned .rpt files.
When I load the reports I loop thru the CRViewer control array loading each of the 4 report files. The reports load without a problem.
However, when I resize the form all the CRViewer controls contain the first report - the report loaded on CRViewer(0) on tab 1 of the SSTab control.

Here's the code used to load the reports and resize the form.

VB Code:
  1. Private Sub cmdView_Report_Click()
  2.     sstbReports.Tab = 0
  3.     DisplayPresPrev Trim$(txtyear), CStr(cmbSIC.ItemData
  4.                                                        (cmbSIC.ListIndex))
  5. End Sub
  6.  
  7. Private Sub DisplayPresPrev(ByVal sThis_Year As String, ByVal  
  8.                                                                        sSic_Code As String)
  9.      
  10.     Dim i As Integer
  11.    
  12.     On Error GoTo errCRX
  13.    
  14.     Set m_Application = New CRAXDRT.Application
  15.     Set m_Report = Nothing
  16.           m_Application.LogOnServerEx "pdsodbc.dll", "EconAct", "EAS003",
  17.                                                 "richard", "branson", "ODBC"
  18.  
  19.     For i = 0 To 3
  20.         Set m_Report = m_Application.OpenReport("D:\Program    
  21.                               Files\Microsoft Visual Studio\VB98
  22.                               \Reports\rptPresPrev" &  CStr(i+1)  & ".rpt",1)
  23.        
  24.         Set CRXParamDefs = m_Report.ParameterFields
  25.        
  26.         For Each CRXParamDef In CRXParamDefs
  27.             Select Case CRXParamDef.ParameterFieldName
  28.                 Case "@this_Year"
  29.                     CRXParamDef.SetCurrentValue Trim$(sThis_Year)
  30.                 Case "@sic_Code"
  31.                     CRXParamDef.SetCurrentValue Trim$(sSic_Code)
  32.             End Select
  33.         Next
  34.        
  35.         If sstbReports.Enabled = False Then
  36.               sstbReports.Enabled = True
  37.         End If
  38.        
  39.         CRViewer(i).ReportSource = m_Report
  40.  
  41.         m_Report.EnableParameterPrompting = False
  42.  
  43.         CRViewer(i).ViewReport
  44.  
  45.         CRViewer(i).Zoom 1
  46.        
  47.         Set m_Report = Nothing
  48.     Next
  49.    
  50.     Set m_Application = Nothing
  51.    
  52.     Exit Sub
  53.    
  54. errCRX:
  55.     MsgBox Err.Number & vbCrLf & Err.Description
  56. End Sub
  57.  
  58. Private Sub Form_Resize()
  59.     On Error Resume Next
  60.     Dim j As Integer
  61.  
  62.     If Me.WindowState = 1 Then Exit Sub
  63.     If Me.Height < 7290 Then Me.Height = 7290
  64.     If Me.Width < 9495 Then Me.Width = 9495
  65.  
  66.     sstbReports.Left = 0
  67.     sstbReports.Top = 1560
  68.     sstbReports.Height = ScaleHeight - frameReports.Height - 120
  69.     sstbReports.Width = ScaleWidth - 5
  70.  
  71.     For j = 0 To 3
  72.         CRViewer(j).Left = 120
  73.         CRViewer(j).Top = 700
  74.         CRViewer(j).Height = sstbReports.Height - 460 -  
  75.                                           sstbReports.TabHeight
  76.         CRViewer(j).Width = sstbReports.Width - 360)
  77.     Next
  78. End Sub

The report names are rptPresPrev1, rptPresPrev2, rptPresPrev3 and rptPresPrev4.
What am I doing wrong?

Thanks.