G gr Sep 14, 2004 #1 Hello, how can I set the default value of a date field equal to the last value + 2 weeks? Thx!
A Allen Browne Sep 14, 2004 #2 Use the AfterUpdate event procedure of the text box to create a string to assign to its DefaultValue property: Private Sub MyDate_AfterUpdate() Me.MyDate.DefaultValue = """" & DateAdd("d", 14, Me.MyDate) & """" End Sub DateAdd() adds the 14 days. The quote marks are needed to turn the result into the string. The default value is seen when you move to the new record.
Use the AfterUpdate event procedure of the text box to create a string to assign to its DefaultValue property: Private Sub MyDate_AfterUpdate() Me.MyDate.DefaultValue = """" & DateAdd("d", 14, Me.MyDate) & """" End Sub DateAdd() adds the 14 days. The quote marks are needed to turn the result into the string. The default value is seen when you move to the new record.