"...pending changes exceeds limit."

R

Robert S. Johnson

I am trying to adapt this code for another use. However
first i must get it working without changes. It is suppose
to allow you to reassign work from one person to another.
You are suppose to be able to reassign one "issue" or any
number you select. I can reasign one. I can not reassign
more than one at a time. Can someone tell me what I have
done to generate an error which says, Runtime error '-
2147217836(80040e541): "Number of rows with pending
changes exceeds limit."

The following line is highlighted when the Debug cmd is
clicked in the error message box;
rstIssues!AssignedTo = NewAssignee

The is all the code in the sub.
Private Sub ReassignSelected_Click()
' Open a recordset and reassign selected issues.

Dim strMessage As String
Dim cnn As Connection
Dim rstIssues As New ADODB.Recordset
Dim varPosition As Variant

' Make sure NewAssignee has a value selected.
If IsNull(NewAssignee) Then
DisplayMessage "You must select an employee to
assign issues to."
Exit Sub
End If

' Make sure one or more issues are selected.
If IssueList.ItemsSelected.Count = 0 Then
DisplayMessage "You must select issues to
reassign."
Exit Sub
End If

' Confirm the reassignment.
strMessage = "Reassign selected issues to " &
NewAssignee.Column(1) & "?"
If Confirm(strMessage) Then

' Display the hourglass icon while reassigning
issues.
DoCmd.Hourglass True

'Open a recordset object in the current database.
Set cnn = CurrentProject.Connection
rstIssues.Open "Issues", cnn, adOpenKeyset,
adLockBatchOptimistic, adCmdTableDirect

'Begin a Transaction before changing data.
cnn.BeginTrans

'Set the index property to search on the primary key.
rstIssues.Index = "IssueID"

'Loop through each issue selected in the list.
For Each varPosition In IssueList.ItemsSelected

'Find the record in the Issue table.
rstIssues.Seek IssueList.ItemData(varPosition)

'Change the AssignedTo value in the table.
rstIssues!AssignedTo = NewAssignee
rstIssues.Update
Next varPosition

'Save all changes for this transaction.
cnn.CommitTrans



' Update the form to display reassigned issues.
AssignedTo = NewAssignee
NewAssignee = Null
IssueList.Requery
DoCmd.Hourglass False

End If

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top