Advertisement
Advertisement
| 02.06.2008 at 07:53AM PST, ID: 23141569 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: |
Private Sub btnSaveChange_Click()
Select Case Me!FrameOptions
Case 1
DoCmd.Close
Case 2
If [LstItems].Value <> 0 Then
Dim OldItems As New ADODB.Recordset
OldItems.Open "Supplier", CurrentProject.Connection, _
CursorType:=adOpenKeyset, LockType:=adLockBatchOptimistic
Do While Not OldItems.EOF
If OldItems("ItemID") = [LstItems].Value Then
OldItems("ItemID") = [lstFreeItems].Value
OldItems.Update
End If
OldItems.MoveNext
Loop
Else
MsgBox ("No items are assigned to this contact")
End If
DoCmd.Close
Case 3
Dim Items As New ADODB.Recordset
Items.Open "Supplier", CurrentProject.Connection, _
CursorType:=adOpenKeyset, LockType:=adLockBatchOptimistic
Do While Not Items.EOF
If Items("ItemID") = [LstItems].Value Then
Items.Delete
Items.Update
End If
Items.MoveNext
Loop
DoCmd.Close
End Select
End Sub
|