B can not be Null, C can only be null if A is AI. A can only be AI, AA or AC.
B will be the only field not changed after initial input. When A is changed
I need D to change. This will be on a form. B, C and D are formated for
medium date.
OK... then, in the AfterUpdate event of the control for A (a Combo Box
or Listbox I presume) put code like:
Private Sub cboA_AfterUpdate()
SELECT Case Me!cboA
Case "AI"
Me!txtD = DateAdd("d", 600, Me!txtB)
Case "AA"
Me!txtD = DateAdd("yyyy", 1, Me!txtC)
' use "d", 365 if you want literally 365 days, e.g. to have
' June 1, 2007 give you May 31, 2008 because of leapyear
Case "AC"
Me!txtD.SetFocus
MsgBox "Enter a date in D", vbOKOnly
Case Else
MsgBox "oops, this should never happen", vbOKOnly
End Select
End Sub
John W. Vinson[MVP]