M
Mark A. Sam
Hello,
In the procedure below, there is an edit and an addnew method. The edit
method works fine, and the addnew method gets addressed, but new records are
not created. They don't show up in the table.
Thanks for any help and God Bless,
Mark A. Sam
Private Sub Form_AfterDelConfirm(Status As Integer)
On Error Resume Next
Dim i As Integer
Dim cnt As Integer
With Me.RecordsetClone
.MoveLast
Do Until .BOF
cnt = DCount("[drop]", "LoadSheetsST", "[LSID] = " & [LSID] & " And [Drop]
= " & ![Drop]) 'Allows using same number for multiple records
i = i + 1
If ![KeepDropNumber] = True Then
i = ![Drop] '+ 1
Else
.Edit
![Drop] = i
.Update
End If
.MovePrevious
Loop
'Check for missing Drops in and insert them
Dim iMin As Integer
Dim iMax As Integer
iMin = Nz(DMin("[drop]", "LoadSheetsST", "[LSID] = " & [LSID]), 0)
iMax = Nz(DMax("[drop]", "LoadSheetsST", "[LSID] = " & [LSID]), 0)
For i = iMin To iMax
If DCount("[drop]", "LoadSheetsST", "[LSID] = " & [LSID] & " And [Drop]
= " & i) = 0 Then 'This drop needs to be created
.AddNew
![Drop] = i
.Update
End If
Next i
.Requery
End With
In the procedure below, there is an edit and an addnew method. The edit
method works fine, and the addnew method gets addressed, but new records are
not created. They don't show up in the table.
Thanks for any help and God Bless,
Mark A. Sam
Private Sub Form_AfterDelConfirm(Status As Integer)
On Error Resume Next
Dim i As Integer
Dim cnt As Integer
With Me.RecordsetClone
.MoveLast
Do Until .BOF
cnt = DCount("[drop]", "LoadSheetsST", "[LSID] = " & [LSID] & " And [Drop]
= " & ![Drop]) 'Allows using same number for multiple records
i = i + 1
If ![KeepDropNumber] = True Then
i = ![Drop] '+ 1
Else
.Edit
![Drop] = i
.Update
End If
.MovePrevious
Loop
'Check for missing Drops in and insert them
Dim iMin As Integer
Dim iMax As Integer
iMin = Nz(DMin("[drop]", "LoadSheetsST", "[LSID] = " & [LSID]), 0)
iMax = Nz(DMax("[drop]", "LoadSheetsST", "[LSID] = " & [LSID]), 0)
For i = iMin To iMax
If DCount("[drop]", "LoadSheetsST", "[LSID] = " & [LSID] & " And [Drop]
= " & i) = 0 Then 'This drop needs to be created
.AddNew
![Drop] = i
.Update
End If
Next i
.Requery
End With