function error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ajaym83
    New Member
    • Feb 2008
    • 3

    function error

    1. i hav one modul in which only connection open and connection close sub esist. both are public defined
    2. i have some private sub fun() in my main frm application
    prob: when i execute the application connection is opened when form loads.
    it is working properly
    but when i invoke some private sub like filllist() , fillcombo
    it generates an error message below:
    operation is not allows\ed when the object is opened
    run time error:3705
  • lotus18
    Contributor
    • Nov 2007
    • 865

    #2
    Originally posted by ajaym83
    1. i hav one modul in which only connection open and connection close sub esist. both are public defined
    2. i have some private sub fun() in my main frm application
    prob: when i execute the application connection is opened when form loads.
    it is working properly
    but when i invoke some private sub like filllist() , fillcombo
    it generates an error message below:
    operation is not allows\ed when the object is opened
    run time error:3705
    As I understand, when you open an object you need to close it.
    [CODE=vb]ObjectName.Clos e[/CODE]

    You can post some of your codes here for the reference of our experts here.

    Comment

    • debasisdas
      Recognized Expert Expert
      • Dec 2006
      • 8119

      #3
      It seems you are trying to open the connection again while the connection is still opened.

      Always check for connection state before opening the connection..

      Comment

      • ajaym83
        New Member
        • Feb 2008
        • 3

        #4
        how can i resolve it

        Comment

        • QVeen72
          Recognized Expert Top Contributor
          • Oct 2006
          • 1445

          #5
          Hi,

          Close the Recordset before Opening it and after you are finished using it.....

          Set RST = Nothing
          RST.Open .....
          'Close it after usage
          RST.Close


          REgards
          Veena

          Comment

          • Killer42
            Recognized Expert Expert
            • Oct 2006
            • 8429

            #6
            I think it would help if you could show us the exact statement which generates the error.

            Comment

            Working...