Douglas J. Steele said:
Since DefaultValue is a text property (regardless of what type of data
the
value may be), see whether this works any better:
Private Sub Purchase_Date_AfterUpdate()
Me.[Warranty_Expiration].DefaultValue = Chr$(34) & DateAdd("yyyy", 3,
Me.[Purchase_Date]) & Chr$(34)
End Sub
Chr$(34) returns a double quote.
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
Hmmm.....
I tried the following, and nothing happens when I tab from "Purchase
Date"
into "Warranty Expiration", but when I add another record "Warranty
Expiration" defaults to 12/30/1899 as soon as the form opens.
Private Sub Purchase_Date_AfterUpdate()
Me.[Warranty_Expiration].DefaultValue = DateAdd("yyyy", 3,
Me.[Purchase_Date])
End Sub
:
In the AfterUpdate event of the PurchaseDate field, put code like:
Private Sub PurchaseDate_AfterUpdate
Me![WarranyExpiration].DefaultValue = DateAdd("yyyy", 3,
Me.[PurchaseDate])
End Sub
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
The user inputs a Purchase Date for a piece of equipment, and I'd
like
to
default the next field, Warranty Expiration, to Purchase Date plus
three
years. The user could still change it in the event that warranty on
that
piece is not actually 3 years.
I'm not sure the best way to accomplish this.
thx