-
Where (which subroutine .etc) do I set the recordset and connection, so that I'll be able to access the database throughout the forms?
I had tried to put the statement in form_activate, but I couldn't access the database in another subroutine.
I need to assign a string with my database field.
dim sName as String
sName = adoStudent!Name
can this be done?
TIA
-
"Where" is not important, in this instance. In order to acess the data across forms, you need to make the recordset/connection "global" or "public".
-
I change from
Dim myConnection As ADODB.Connection
Dim myRecordSet As ADODB.Recordset
to
Public myConnection As ADODB.Connection
Public myRecordSet As ADODB.Recordset
however it gives a error message of "Invalid attribute in Sub or in Function"
What is wrong??
TIA
-
You're probably trying to do the declaration in a form module. It should be done in a code module (in the declaration section).
Edited by JHausmann on 03-16-2000 at 04:12 PM
-
thanks alot.... its working now :)