T
tapan82
HELP! HELP! HELP!
I'm working on a project and have defined the following connection and
recordset in the Load event of the Form but when I click on the Save
button on the same form to save the data to the table using the
recordset it gives me an error saying "Compile error: Variable not
defined". I don't know why the connection and recordset is not
accessible when called from other events.
Load_Form
Dim Con As New ADODB.Connection
Dim Rst As New ADODB.Recordset
Set Con = CurrentProject.AccessConnection
Rst.ActiveConnection = Con
Rst.Source = "Select * from Master"
Rst.LockType = adLockOptimistic
Rst.CursorType = adOpenKeyset
Rst.Open
Set Me.Recordset = Rst
Save_Click
Rst![LIEN STATUS] = "WORK IN PROGRESS"
Me.txtLien = "WORK IN PROGRESS"
I'm working on a project and have defined the following connection and
recordset in the Load event of the Form but when I click on the Save
button on the same form to save the data to the table using the
recordset it gives me an error saying "Compile error: Variable not
defined". I don't know why the connection and recordset is not
accessible when called from other events.
Load_Form
Dim Con As New ADODB.Connection
Dim Rst As New ADODB.Recordset
Set Con = CurrentProject.AccessConnection
Rst.ActiveConnection = Con
Rst.Source = "Select * from Master"
Rst.LockType = adLockOptimistic
Rst.CursorType = adOpenKeyset
Rst.Open
Set Me.Recordset = Rst
Save_Click
Rst![LIEN STATUS] = "WORK IN PROGRESS"
Me.txtLien = "WORK IN PROGRESS"