![]() |
|
#1
|
||||
|
||||
![]()
Hi Philip,
Assuming your textboxes are on a userform and are named TextBox1, TextBox2 & TextBox3, with the date in TextBox1 and the # days in TextBox2, try: Code:
Private Sub TextBox1_AfterUpdate() If TextBox2.Value = "" Then TextBox2.Value = 0 MsgBox DateAdd("d", CInt(TextBox2.Value), CDate(TextBox1.Text)) TextBox3.Text = Format(DateAdd("d", CInt(TextBox2.Value), CDate(TextBox1.Text)), "DD/MMMM/YYYY") End Sub Private Sub TextBox2_AfterUpdate() If TextBox1.Text = "" Then TextBox1.Text = Format(Now, "DD/MMMM/YYYY") MsgBox DateAdd("d", CInt(TextBox2.Value), CDate(TextBox1.Text)) TextBox3.Text = Format(DateAdd("d", CInt(TextBox2.Value), CDate(TextBox1.Text)), "DD/MMMM/YYYY") End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Date pop-up window | Roshan Hanief | Word | 0 | 04-23-2011 04:16 AM |
Creating an Auto-Calc'd Date? Today+7 Days? | SoCalTelephone | Word | 0 | 10-06-2010 10:27 AM |
![]() |
windseaker | Excel | 1 | 02-14-2010 01:44 AM |
new appointment date always reverts back to today's date | msills | Outlook | 0 | 08-24-2007 08:57 AM |
![]() |
promark | Outlook | 1 | 12-23-2005 07:21 AM |