Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Compile error

Compile error

Scheduled Pinned Locked Moved Visual Basic
helpquestioncareer
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    tatchung
    wrote on last edited by
    #1

    Hello, I'm trying to compile a vb6 application I've made but I keep getting this error below

    Compile Error in File 'D:\TAT\VB6\apps\go bingo\Connection.bas', Line 121 : Sub or Function not defined

    Line 121 consists of this block of code...

    Function addrec(myform As Form, mydata As adodc)
    On Error Resume Next
    mydata.Recordset.AddNew
    mycmd = cmds(myform, False)
    addflag = True
    End Function

    ...line 21 is mydata.Recordset.AddNew. I've tried to comment-out the code but the error keeps persisting. How could I compile the project properly? Many thanks for your replies. :-D

    Aim small, miss small

    D 1 Reply Last reply
    0
    • T tatchung

      Hello, I'm trying to compile a vb6 application I've made but I keep getting this error below

      Compile Error in File 'D:\TAT\VB6\apps\go bingo\Connection.bas', Line 121 : Sub or Function not defined

      Line 121 consists of this block of code...

      Function addrec(myform As Form, mydata As adodc)
      On Error Resume Next
      mydata.Recordset.AddNew
      mycmd = cmds(myform, False)
      addflag = True
      End Function

      ...line 21 is mydata.Recordset.AddNew. I've tried to comment-out the code but the error keeps persisting. How could I compile the project properly? Many thanks for your replies. :-D

      Aim small, miss small

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      You defined a function but did not supply a return value type. It should be:

      Function addrec(myform As Form, mydata As adodc) As someType

      If you're not returning a value to the caller, change Function to Sub.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007, 2008

      T 1 Reply Last reply
      0
      • D Dave Kreskowiak

        You defined a function but did not supply a return value type. It should be:

        Function addrec(myform As Form, mydata As adodc) As someType

        If you're not returning a value to the caller, change Function to Sub.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007, 2008

        T Offline
        T Offline
        tatchung
        wrote on last edited by
        #3

        Oh... :laugh: My apologies for the novice post. Thanks for the help Sir! Works perfectly now :-D

        Aim small, miss small

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups