Results 1 to 4 of 4

Thread: User-defined type not found Error

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2010
    Posts
    32

    User-defined type not found Error

    Hi..

    Am getting error as compile error: user-defined type not found. plz help me...
    The code like this..

    Code:
    Option Explicit
    Public gIntMode As Integer
    Dim Report As New rptCumulativeSawBlade[Error]
    Dim fArrSValues(0)
    Private Sub cmdClose_Click()
        Unload Me
    End Sub
    Private Sub cmdPrint_Click()
    On Error GoTo ErrHandler
        
        If Val(TxYear.Text) < 2000 Or CbMonth.ListIndex < 0 Then
            MsgBox "Invalid Month/Year Entry"
            Exit Sub
        End If
        
        fArrSValues(0) = Format(CbMonth.ListIndex + 1, "00") & "/" & TxYear
        PrintCumulativeSawBlade
        cmdPrint.Caption = "Refresh"
        
        Exit Sub
    ErrHandler:
        Me.SetFocus
        MsgBox "Error in printing enquiries: " & Err.Description
    End Sub
    Private Sub Form_Activate()
    On Error Resume Next
        SetMenus True
    End Sub
    Private Sub Form_Load()
    On Error Resume Next
        'Add to the count of child forms opened. The method is defined
        
        CbMonth.ListIndex = (Month(Date) - 1)
        TxYear.Text = Year(Date)
    
        AddChildFormCount
     
        'Initialize the mode to "default mode"
        gIntMode = gcIntDefaultMode
        
        
        'INITIALIZATION of form parameter count
        
        cmdPrint_Click
        
    End Sub
    Private Sub Form_Unload(Cancel As Integer)
        RemoveChildFormCount
    End Sub
    Private Sub PrintCumulativeSawBlade()
        ShowReport Report, CRViewer1, fArrSValues
    End Sub

  2. #2
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: User-defined type not found Error

    And what is that rptCumulativeSawBlade type? If it is a Class, did you include it in the Project? If it comes from a reference, did you add the reference to the Project?

  3. #3

    Thread Starter
    Member
    Join Date
    Mar 2010
    Posts
    32

    Re: User-defined type not found Error

    It is not a class... how to add the reference to the project..?

  4. #4
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: User-defined type not found Error

    For adding Reference: Project menu --> References --> Tick mark the item that you needed.

    Also, for defining a object, this will be better:
    Code:
    Dim Report As rptCumulativeSawBlade
    set Report = New rptCumulativeSawBlade
    I believe that rptCumulativeSawBlade is a Class Module.
    ..

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

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