ld like to put some recordset handling in a common module. When I try to call it from a form I get an error:
"The expression On Click you entered as the event
property setting produced the following error:
Invalid Outside Procedure.
* The expression may not result in the name of a macro,
the name of a user defined function, or [Event
Procedure].
* There may have been an error evaluating the function,
event, or macro."
My code is:
(tableHandling) module:
Option Compare Database
Option Explicit
Dim rstReqSched As ADODB.Recordset
Set rstReqSched = New ADODB.Recordset
rstReqSched.CursorLocation = adUseClient
Public Sub Open_ReqSched()
rstReqSched.Open "tblRequestSchedule", CurrentProject.Connection, adOpenStatic, adLockOptimistic
'
End Sub
Form:
Private Sub cmdSchedule_Click()
Open_ReqSched
.....other code.....
End Sub
Any suggestions?
"The expression On Click you entered as the event
property setting produced the following error:
Invalid Outside Procedure.
* The expression may not result in the name of a macro,
the name of a user defined function, or [Event
Procedure].
* There may have been an error evaluating the function,
event, or macro."
My code is:
(tableHandling) module:
Option Compare Database
Option Explicit
Dim rstReqSched As ADODB.Recordset
Set rstReqSched = New ADODB.Recordset
rstReqSched.CursorLocation = adUseClient
Public Sub Open_ReqSched()
rstReqSched.Open "tblRequestSchedule", CurrentProject.Connection, adOpenStatic, adLockOptimistic
'
End Sub
Form:
Private Sub cmdSchedule_Click()
Open_ReqSched
.....other code.....
End Sub
Any suggestions?