VB 6.0 - Compile Error : sub or function is not defined:

Asked By Sylvester Sorbito on 15-Oct-11 08:55 PM
Compile Error :
sub or function is not defined:

can you please help me how to resolve this.....


Dim RS As New ADODB.Recordset
Private Sub cmdnew_Click()
Frame1.Enabled = True
T1.SetFocus
cmdsave.Enabled = True
cmdnew.Enabled = False
clearInputs
End Sub


tnx.....
Riley K replied to Sylvester Sorbito on 15-Oct-11 11:19 PM

   Hi,

     Your code is correct only, but this error usually occurs because of spelling mistakes

    Possible causes of this error include:

  • Misspelling the procedure name.

  • Trying to call a procedure from another project without explicitly adding a reference to that project in the References dialog box.

  • Specifying a procedure that is not visible to the calling procedure.

    To correct this error


    1. Make sure that the procedure name is spelled correctly.

    2. Find the name of the project containing the procedure you want to call in the References dialog box. If it does not appear, click the Browse button to search for it. Select the check box to the left of the project name, and then click OK.

    3. Check the name of the routine.

    Regards

Anoop S replied to Sylvester Sorbito on 15-Oct-11 11:53 PM
normally this will happens when you not define some function or some spelling mistake  happens when you call funtion
Make sure that the function clearInputs defined correctly  like
Kirtan Patel replied to Sylvester Sorbito on 16-Oct-11 03:16 AM
Dim RS As New ADODB.Recordset
Private Sub cmdnew_Click()
Frame1.Enabled = True
T1.SetFocus
cmdsave.Enabled = True
cmdnew.Enabled = False
clearInputs
End Sub


Here clear input is not clear what it is correct it its the root of problem 

Thanks
Rohan Dave replied to Sylvester Sorbito on 16-Oct-11 04:46 AM
generally this error will occur when , you haven't defined function or sub and you are trying to access that..

from your codee , i guesss error may come from clearInputs. just make sure you have defined sub or function with this name and also make sure there is no spelling mistake at all in name...