HI
Quick question on variab;e scope within a form, If I declare a variable in the delararations section:-
Option Compare Database
Public Frm_RstADO As ADODB.Recordset
Public Frm_CnnADO As ADODB.Connection
Then set the variable:-
Set Frm_CnnADO = CurrentProject.AccessConnection
Set Frm_RstADO = New ADODB.Recordset
Use it and when finished with it set it to nothing
Set Frm_RstADO = Nothing
Set Frm_CnnADO = Nothing
Is is still avaiable later on in the form by just resetting it again with:-
Set Frm_CnnADO = CurrentProject.AccessConnection
Set Frm_RstADO = New ADODB.Recordset
??
Thnx
Quick question on variab;e scope within a form, If I declare a variable in the delararations section:-
Option Compare Database
Public Frm_RstADO As ADODB.Recordset
Public Frm_CnnADO As ADODB.Connection
Then set the variable:-
Set Frm_CnnADO = CurrentProject.AccessConnection
Set Frm_RstADO = New ADODB.Recordset
Use it and when finished with it set it to nothing
Set Frm_RstADO = Nothing
Set Frm_CnnADO = Nothing
Is is still avaiable later on in the form by just resetting it again with:-
Set Frm_CnnADO = CurrentProject.AccessConnection
Set Frm_RstADO = New ADODB.Recordset
??
Thnx