I am running Access 2003 and need some advice regarding a continuous subform. The main form is unbound and the continuous subform is bound to a temporary table. When the user clicks the "submit" button, the code writes the data to a "permanent" table. There are times, however, when there will be no data on the subform, so as a work around, I am using an If IsNull....Then statement:
However, and I suppose this is due to the nature of subforms, the code sometimes "skips" when the value in the TempCM field is NOT null. Does anyone have any advice and or a work around to this issue? Thank you.
Code:
If IsNull(Forms![frmProblemInvestigation]!subfrmPITempCM.Form!TempCM.Value) Then
'Do Nothing
Else
HoldPITempRS.MoveFirst
Do While Not HoldPITempRS.EOF
PITempRS.AddNew
PITempRS.Fields("ProblemInvestigationID").Value = HoldProblemInvestigationID
PITempRS.Fields("TempCM").Value = HoldPITempRS!TempCM
PITempRS.Fields("Responsible").Value = HoldPITempRS!Responsible
PITempRS.Fields("TargetDate").Value = HoldPITempRS!TargetDate
PITempRS.Fields("ActualDate").Value = HoldPITempRS!ActualDate
PITempRS.Update
HoldPITempRS.MoveNext
Loop
End If
PITempRS.Close
However, and I suppose this is due to the nature of subforms, the code sometimes "skips" when the value in the TempCM field is NOT null. Does anyone have any advice and or a work around to this issue? Thank you.