Error: Compile error:user-defined type not defined-VBForums
Results 1 to 6 of 6

Thread: Error: Compile error:user-defined type not defined

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2010
    Posts
    32

    Error: Compile error:user-defined type not defined

    Hi..

    Am getting error, Compile error:user-defined type not defined how to solve this.. The code like this

    Option Explicit
    Public gIntMode As Integer
    Dim Report As New rptCumulativeSawBlade
    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, fArrSValues........[Error]
    End Sub

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    37,238

    Re: Error: Compile error:user-defined type not defined

    Welcome to VBForums

    See the "Fixing common VB errors" link in my signature, it has a section on dealing with that error.

  3. #3
    PowerPoster
    Join Date
    May 2002
    Posts
    25,964

    Re: Error: Compile error:user-defined type not defined

    1) I'm surprised Si, thread shouldn't be in Database Developmnet, has nothing to do with databases.
    2) Arunvb - what version of VB are you using?

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  4. #4

    Thread Starter
    Member
    Join Date
    Mar 2010
    Posts
    32

    Re: Error: Compile error:user-defined type not defined

    it is vb 6.0

  5. #5
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    37,238

    Re: Error: Compile error:user-defined type not defined

    Quote Originally Posted by techgnome View Post
    1) I'm surprised Si, thread shouldn't be in Database Developmnet, has nothing to do with databases.
    Me too... not sure how I missed that!

    Thread moved from 'Database Development' forum to the 'VB6 and earlier' forum

  6. #6
    PowerPoster
    Join Date
    May 2002
    Posts
    25,964

    Re: Error: Compile error:user-defined type not defined

    @arunvb - on which line does the error occur? We're not mind readers, so it would help if you could point out which line is the problem.

    Also, in the future, put [code][/code] or [highlight=vb][/highlight] tags around your code? It preserves the indenting, making the code a lot easier to read.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.