Sorry if this will be a duplicate thread. Yesterday I started a thread with exact the same title but, somehow, it disappear from the forum
So:
Access 2007
In a table I have 2 fields:
D1 , Date/Time , DefaultValue: Date()
D2 , Date/Time , DefaultValue: Date()+1
In a form (bounded to this table) I have, of course, 2 controls bounded to this fields:
txtD1 and txtD2
If the user change the value in txtD1 (using the Date picker) I like to change the DefaultValue for txtD1 to the new date and the DefaultValue for txtD2 to the new date + 1 day.
Something like this:
I tried whatever crossed my stupid head... with the same "result" : #Name?
My Regional settings:
Short date format: dd.MM.yyyy
Date separator: Dot
Simple: 05.12.2013
Can you help me ?
Thank you !
So:
Access 2007
In a table I have 2 fields:
D1 , Date/Time , DefaultValue: Date()
D2 , Date/Time , DefaultValue: Date()+1
In a form (bounded to this table) I have, of course, 2 controls bounded to this fields:
txtD1 and txtD2
If the user change the value in txtD1 (using the Date picker) I like to change the DefaultValue for txtD1 to the new date and the DefaultValue for txtD2 to the new date + 1 day.
Something like this:
Code:
Private Sub txtD1_AfterUpdate()
Me.txtD1.DefaultValue = Me.txtD1
Me.txtD2.DefaultValue = Me.txtD1 + 1 day
End Sub
My Regional settings:
Short date format: dd.MM.yyyy
Date separator: Dot
Simple: 05.12.2013
Can you help me ?
Thank you !