Hello,
I am trying to get child records to auto-populate a date from the parent record, and there are three situations.
Case 1: If Rejected_Date is not null, use it.
Case 2: If Accepted Date is not null, use it instead.
Case 3: Both are null, and the user needs to be forced to enter one before continuing.
Here is my code thus far: (it is currently throwing a compile error "Statement invalid outside Type block")
Can you see what I am doing wrong? THanks!
Code:Private Sub Form_BeforeUpdate(Cancel As Integer) Dim msgrslt As Variant If IsNull(Me.Defect_Date) = True Then Select Case Me.Defect_Date Case IsNull([Forms]![frm_final_inspection].Rejected_Date) = False Me.Defect_Date = [Forms]![frm_final_inspection].Rejected_Date Case IsNull([Forms]![frm_final_inspection].Accepted_Date) = False Me.Defect_Date = [Forms]![frm_final_inspection].Accepted_Date Case IsNull([Forms]![frm_final_inspection].Rejected_Date), IsNull([Forms]![frm_final_inspection].Accepted_Date) msgbox("Rejection Date is a required field. Please enter a value before continuing.", vbOKOnly, [Required Field]) As msgrslt Exit Sub End Select End If End Sub