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:
Private Sub Form_Unload(Cancel As Integer) If CN.Open > 0 Then CN.Close Set CN = Nothing End If End Sub 'and Private Sub Form_Unload(Cancel As Integer) If CN.Open = True Then CN.Close Set CN = Nothing End If End Sub 'and Private Sub Form_Unload(Cancel As Integer) If Len(CN.Open) > 0 Then CN.Close Set CN = Nothing End If 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...







Reply With Quote