Results 1 to 3 of 3

Thread: Run-Time error 438. Please help

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2017
    Posts
    2

    Run-Time error 438. Please help

    I have a small VB application with CrystalReports integration. The source I was given fails to compile for a missing reference and the debugger highlights the first line here:

    Code:
    Dim Report As New CrystalReport1
    
    Private Sub Form_Load()
    Screen.MousePointer = vbHourglass
    CRViewer91.ReportSource = Report
    Report.DiscardSavedData
    CRViewer91.ViewReport
    Screen.MousePointer = vbDefault
    
    End Sub
    
    Private Sub Form_Resize()
    CRViewer91.Top = 0
    CRViewer91.Left = 0
    CRViewer91.Height = ScaleHeight
    CRViewer91.Width = ScaleWidth
    
    End Sub
    I removed the missing reference, commented out the offending Dim, and then added new Dims. The resulting code looks like this:

    Code:
    'Dim Report As New CrystalReport1
    Dim crystal As New CRAXDRT.Application
    Dim Report As New CRAXDRT.Report
    
    Private Sub Form_Load()
    Screen.MousePointer = vbHourglass
    CRViewer91.ReportSource = Report
    Report.DiscardSavedData
    CRViewer91.ViewReport
    Screen.MousePointer = vbDefault
    
    End Sub
    
    Private Sub Form_Resize()
    CRViewer91.Top = 0
    CRViewer91.Left = 0
    CRViewer91.Height = ScaleHeight
    CRViewer91.Width = ScaleWidth
    
    End Sub
    Then I compile this code I get the run-time error 438, "Object doesn't support this property or method." The debugger highlights this line "CRViewer91.ReportSource = Report"

    Does anyone have any guidance on how I can fix this and get a working application.

  2. #2

    Thread Starter
    New Member
    Join Date
    Jul 2017
    Posts
    2

    Re: Run-Time error 438. Please help

    Please be aware that the code changes I made above were provided in another version of the source code. I do not really know much about VB programming as I am self-taught C#. Luckily, I can be retaught.

  3. #3
    PowerPoster jdc2000's Avatar
    Join Date
    Oct 2001
    Location
    Idaho Falls, Idaho USA
    Posts
    2,393

    Re: Run-Time error 438. Please help


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width