Hello again. Ok, everthing is coming along well, but if I run my program and close it before I make a connection, I get a Object Variable or With block variable not set. I tried to use:

VB Code:
  1. Private Sub Form_Unload(Cancel As Integer)
  2. If CN.Open > 0 Then
  3.     CN.Close
  4.     Set CN = Nothing
  5. End If
  6.  
  7. End Sub
  8.  
  9. 'and
  10.  
  11. Private Sub Form_Unload(Cancel As Integer)
  12. If CN.Open = True Then
  13.     CN.Close
  14.     Set CN = Nothing
  15. End If
  16.  
  17. End Sub
  18.  
  19. 'and
  20.  
  21. Private Sub Form_Unload(Cancel As Integer)
  22. If Len(CN.Open) > 0 Then
  23.     CN.Close
  24.     Set CN = Nothing
  25. End If
  26.  
  27. End Sub

to see if the connection string was open, and close it if it was and if not then exit the program without trying to close something that is not open. They all error, if there is no connection. I need to find a way to make the program not error when user(me) clicks the trapclose without connecting first. It works fine if I establish a connection first. If you need me to, I can post the code I have so far. But it is getting a bit lengthy at this point so if you know what I am refering to, then I won't have to use unneccessary space. Thanks again. I will get through this eventually. I am just learning here...