I'm trying to compare two fields (date1, date2) on the current record of a continuous form. If the user attempts to enter information into Date1 when Date2 is not null, an error message is produced. The code below works fine for single form, but does not distinguish between records on a continuous form. The txtDateChoice shown in code refers to MS Date and Time Picker Control object. Looking for any suggestions!
If Me.txtDateChoice.Value > 0 Then
If Me.ActiveControl.Value = Me.txtDateChoice.Value Then
Me.ActiveControl.Value = ""
Else
Me.ActiveControl.Value = Me.txtDateChoice.Value
DoCmd.Requery
If Forms![frmDates]![Date2].Value > 0 Then
MsgBox "Conflicting records"
Forms![frmDates]![Date1].Value = ""
End If
End If
Else
Me.ActiveControl.Value = ""
End If
Teri
Good decisions come from Wisdom...
Wisdom comes from experience...
Experience comes from bad decisions
If Me.txtDateChoice.Value > 0 Then
If Me.ActiveControl.Value = Me.txtDateChoice.Value Then
Me.ActiveControl.Value = ""
Else
Me.ActiveControl.Value = Me.txtDateChoice.Value
DoCmd.Requery
If Forms![frmDates]![Date2].Value > 0 Then
MsgBox "Conflicting records"
Forms![frmDates]![Date1].Value = ""
End If
End If
Else
Me.ActiveControl.Value = ""
End If
Teri
Good decisions come from Wisdom...
Wisdom comes from experience...
Experience comes from bad decisions