From: Tara on 5 May 2010 11:34 I have a form with two date fields on it - Service Date and Posted Date. Since in most cases the Service Date will be the same as the Posted Date, I have the default value of Posted Date field set to the value of the Service Date field by using the following expression in the default value property: =[ServiceDate]. It's not working though and I'm not sure why.
From: Dorian on 5 May 2010 12:04 Try this in the AfterUpdate event of the first date: Private Sub Date1_AfterUpdate() If Nz(Me!Date1, "") <> "" And Nz(Me!Date2, "") = "" Then Me!Date2 = Me!Date1 End If End Sub -- Dorian "Give someone a fish and they eat for a day; teach someone to fish and they eat for a lifetime". "Tara" wrote: > I have a form with two date fields on it - Service Date and Posted Date. > Since in most cases the Service Date will be the same as the Posted Date, I > have the default value of Posted Date field set to the value of the Service > Date field by using the following expression in the default value property: > =[ServiceDate]. It's not working though and I'm not sure why.
From: Jon Lewis on 5 May 2010 12:07 How are you expecting it to work? A default value only applies to a new record so does ServiceDate have a default value too? In this case just give your PostedDate control the same literal default value as your ServiceDate (although =[ServiceDate] should work too) If you want the PostedDate to default to the ServiceDate after it has been chosen then use the AfterUpdate event of the ServiceDate control to set the PostedDate value. HTH "Tara" <Tara(a)discussions.microsoft.com> wrote in message news:85D22B69-A963-446C-BE4B-B1EAA3F3C4AB(a)microsoft.com... >I have a form with two date fields on it - Service Date and Posted Date. > Since in most cases the Service Date will be the same as the Posted Date, > I > have the default value of Posted Date field set to the value of the > Service > Date field by using the following expression in the default value > property: > =[ServiceDate]. It's not working though and I'm not sure why.
|
Pages: 1 Prev: Reading xlsx file-- examples please Next: Combo box synchronization |