Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2004
    Posts
    1

    Unanswered: Procedure Too Large

    I wrote alot of VB code behind the "On Click" event of a
    commandX button. Upon completion, I'm getting a "Procedure
    Too Large" error (to run). How do I correct
    this or get around this error?


    Here Example

    Private Sub On_Click()
    Select Case Xxxx (Xxx.Xx)

    Case "XXXXXX"
    Xxxxxxxxx.Xxxx = "Xxxxx"
    Xxxxxxxx2.Xxxx = "Xxxxx"
    Case "XXXXXX"
    Xxxxxxxxx.Xxxx = "Xxxxx"
    Xxxxxxxx2.Xxxx = "Xxxxx"
    Case "XXXXXX"
    Xxxxxxxxx.Xxxx = "Xxxxx"
    Xxxxxxxx2.Xxxx = "Xxxxx"
    Case "XXXXXX"
    Xxxxxxxxx.Xxxx = "Xxxxx"
    Xxxxxxxx2.Xxxx = "Xxxxx"


    End Select
    End Sub


    THE PROBLEM IS WE CAN'T GO TO LOTS OF CASEs due to PROCEDURE TOO LARGE When We try to Run or Save. (ONLY Max. 1004 CASEs CAN BE CODEd)

    We donot want to make more than one for commandx_click)

    thanks a lots Guy.

  2. #2
    Join Date
    Mar 2004
    Location
    www.scirocco.ca
    Posts
    346
    The only way to solve this problem is to divide the procedure into several sub-procedures. This is limit in Visual Basic.

    i.e.

    You have one procedure that calls several smaller procedures.

    Sub Main()

    Call SubSmall1
    Call SubSmall2
    .
    .
    .
    End Sub
    http://www.scirocco.ca/images/banner...occobanner.gif

    Download for FREE the ADO/DAO Data Controls that makes life EASIER developing database applications in: VB, FoxPro, Access, VC++, .NET etc... Navigate, Add New, Delete, Update, Search, Undo and Save your changes. Supports Disconnected Recordsets and Transactions!

    Or try our Ask An Expert service to answer any of your questions!

Posting Permissions

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