D
DS
I'm running this code and after I delete the last item it says:
"No Current Record"
How do I get this thing to stop once there are no more record?
Thanks
DS
Private Sub Command74_Click()
If [Sent] = True Then
DoCmd.OpenForm "CantItem"
ElseIf [ItemType] = "2" And [Text70] > 1 Then
DoCmd.RunCommand acCmdDeleteRecord
Me.Refresh
ElseIf [ItemType] = "1" And [Text70] = 1 Then
DoCmd.RunCommand acCmdDeleteRecord
Me.Refresh
ElseIf [ItemType] = "1" And [Text70] > 1 Then
CurrentDb.Execute "DELETE FROM SalesDetails WHERE [LineID]=" & [Text72]
Me.Requery
Me.Parent.Requery
End If
With Forms!Sales.SalesDetails.Form.Recordset
If Forms!Sales.SalesDetails.Form!Text127 = 0 Then
Do While .EOF = False And .BOF = False
.MoveFirst
.Edit
!SDInclusive = True
!SDTaxed = False
.Update
.MoveNext
Loop
End If
End With
DoCmd.GoToRecord , , acLast
End Sub
"No Current Record"
How do I get this thing to stop once there are no more record?
Thanks
DS
Private Sub Command74_Click()
If [Sent] = True Then
DoCmd.OpenForm "CantItem"
ElseIf [ItemType] = "2" And [Text70] > 1 Then
DoCmd.RunCommand acCmdDeleteRecord
Me.Refresh
ElseIf [ItemType] = "1" And [Text70] = 1 Then
DoCmd.RunCommand acCmdDeleteRecord
Me.Refresh
ElseIf [ItemType] = "1" And [Text70] > 1 Then
CurrentDb.Execute "DELETE FROM SalesDetails WHERE [LineID]=" & [Text72]
Me.Requery
Me.Parent.Requery
End If
With Forms!Sales.SalesDetails.Form.Recordset
If Forms!Sales.SalesDetails.Form!Text127 = 0 Then
Do While .EOF = False And .BOF = False
.MoveFirst
.Edit
!SDInclusive = True
!SDTaxed = False
.Update
.MoveNext
Loop
End If
End With
DoCmd.GoToRecord , , acLast
End Sub