-
Hello,
I have a problem and i am sure there is a simple solution. When i create a connection and a recordset in the click event of a button, i can't access the recordset's or connections's properties outside of the sub. It just gives me the "object required" msg. I can manipulate them inside of the same sub, but that's it.
Dont ask y i posted this in this forum, cause i dont know
Thanks in advance!
Kyle
[Edited by Kagey on 01-02-2001 at 07:59 PM]
-
Is your object Variable going out of scope ?
[]P
-
apparently it is. i created it using
Code:
Dim conn as new adodb.connection
Dim rst as new adodb.recordset
when i do this, i can only access their properties inside of the same sub.
-
Never mind, i figured it out. thanks for your help though. It helped me out (which is why it is called help).
later
-
in general declarations
Code:
Private WithEvents con As ADODB.Connection
Private WithEvents rst As ADODB.Recordset
then in the sub i put
Code:
Set con = New ADODB.Connection
Set rst = New ADODB.Recordset
is there a more efficent way of doing it?