Originally Posted by
hertfordkc
Go to the property sheet of Provcode and select the afterupdate property. Click on the 3 dots and select "Code Builder".
The Visual Basic screen will appear with the event handler
Sub Provcode_afterupdate()
End Sub
Insert:
Dim S as string
If [Provcode] = "J07" then
S = "<= #" & Dateadd("d",-21,Date) & "#"
else
S = "<= #" & Date) & "#"
end if
[DOS].validationrule = S
This all depends on how the date field is defined in DOS. I suggest you test by manually inserting a string into the Validation Rule, followed by making sure that the above code gets it right.