hello,

i've sent a program to a friend to test out for me, but he gets a run time error 7 (out of memory) when he clicks on 2 certain things....

i've gone through the code where the error occurs with no luck, so i was hoping maybe someone could see if they can find some error that would cause such a memory leak... works just peachy for me, but not for him... and it ALWAYS happens for him , even after reboot, etc... so it must be my code

here's the code when the button is clicked:

VB Code:
  1. If Not IsConnection Then
  2.         Call CreateConnection(DBCONNECTIONS)
  3.     End If
  4.     WebBrowse.Visible = False
  5.     Call UnloadSubForms
  6.     Load frmBrowse
  7.     SetParent frmBrowse.hWnd, fraMain.hWnd
  8.     frmBrowse.Show

here's the public functions i made that are called:

VB Code:
  1. 'sub to close a global connection
  2. Public Function CloseConnection()
  3. If objConn Is Nothing Then
  4.     'is nothing
  5. Else
  6.     objConn.Close
  7.     Set objConn = Nothing
  8. End If
  9. End Function
  10. 'sub to see if connection exists
  11. Public Function IsConnection()
  12. If objConn Is Nothing Then
  13.     IsConnection = False
  14. Else
  15.     IsConnection = True
  16. End If
  17. End Function

...

last but not least, here's the code on the form's load that is loaded ...

VB Code:
  1. 'delcare variables
  2. Dim objRS As New ADODB.Recordset
  3.  
  4. 'disenable view button
  5. cmdView.Enabled = False
  6.  
  7. 'open recordset
  8. Set objRS = New ADODB.Recordset
  9. objRS.Open "SELECT program FROM programs ORDER by program", objConn, 1, 3
  10. 'loop through recordset
  11. Do Until objRS.EOF
  12.     'add program name to list
  13.     cmbProgram.AddItem objRS("program")
  14.     objRS.MoveNext
  15. Loop
  16. 'close recordset
  17. objRS.Close
  18. Set objRS = Nothing

now, when he clicks on another button that also uses the set parent function, it works fine, so im assuming that function has nothing to do with my problem......

appreciate the help!