G
Gerald Pettway
I have move_first, previous, next, last buttons in my
application and I am getting an error when I attempt to
use them. The error is:Run-Time error '3704' Operation is
not allowed when the object is closed. I have a step that
checks the state of the recordset. It closes the current
recordset and opens a new one. The codes looks like this:
Private Sub cmdMoveFirst_Click()
Dim intRecordCount As Integer
On Error GoTo Handler
blnExitSub = False
blnMoveFirst = True
'Sets the value of the BackOrder property of the
requisition class depending on whether or not
'the user checks the Back Order check box.
If Me.chkBackOrder.Value = -1 Then
Req.BackOrder = True
Else
Req.BackOrder = False
End If
'The program branches off to build the appropriate
recordset
GetSpecificRecordset
If prst.RecordCount = 0 Then
MsgBox "There are no records that meet this
criteria.", vbOKOnly, "No Matching Records"
ClearCboChk
blnExitSub = True
Exit Sub
End If
Handler:
If Err.Number = 3021 Then
MsgBox "A requisition cannot be complete and have
a back order.", vbOKOnly, "Invalid Request"
Exit Sub
End If
SetEqualToClassProperties
PopulateControls
CleanUp
intRecordCount = prst.RecordCount
Me.txtRecordNo = "1"
Me.txtRecordCount = intRecordCount
Any help is appreciated!!
application and I am getting an error when I attempt to
use them. The error is:Run-Time error '3704' Operation is
not allowed when the object is closed. I have a step that
checks the state of the recordset. It closes the current
recordset and opens a new one. The codes looks like this:
Private Sub cmdMoveFirst_Click()
Dim intRecordCount As Integer
On Error GoTo Handler
blnExitSub = False
blnMoveFirst = True
'Sets the value of the BackOrder property of the
requisition class depending on whether or not
'the user checks the Back Order check box.
If Me.chkBackOrder.Value = -1 Then
Req.BackOrder = True
Else
Req.BackOrder = False
End If
'The program branches off to build the appropriate
recordset
GetSpecificRecordset
If prst.RecordCount = 0 Then
MsgBox "There are no records that meet this
criteria.", vbOKOnly, "No Matching Records"
ClearCboChk
blnExitSub = True
Exit Sub
End If
Handler:
If Err.Number = 3021 Then
MsgBox "A requisition cannot be complete and have
a back order.", vbOKOnly, "Invalid Request"
Exit Sub
End If
SetEqualToClassProperties
PopulateControls
CleanUp
intRecordCount = prst.RecordCount
Me.txtRecordNo = "1"
Me.txtRecordCount = intRecordCount
Any help is appreciated!!