theinviter
Registered User.
- Local time
- Yesterday, 20:08
- Joined
- Aug 14, 2014
- Messages
- 240
try this, and don't use Me.[cycle subform], i am already using it's Recordset so no need to use the Form.
Copy and Replace your code.
Code:Private Sub Command1608_Click() Dim bolWithBlank As Boolean Dim bm As Variant On Error GoTo new_Err With Me![cycle subform].Form.RecordsetClone If Not (.BOF And .EOF) Then .MoveFirst Do While Not .EOF If Len(Trim(!Cycle.Value & "")) = 0 Then bolWithBlank = True bm = .Bookmark Exit Do End If .MoveNext Loop If bolWithBlank then .Bookmark = bm .Edit Else .AddNew End If !Cycle = Me.No_of_Cycle.Value !date_ = Date .Update Else .AddNew !Cycle = Me.No_of_Cycle.Value !date_ = Date .Update End If End With new_Err: Msgbox Err.Number & vbcrlf & Err.Description End Sub
the code work well but one issue why the linked ID of man form become blank
see picture