View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Risky Dave Risky Dave is offline
external usenet poster
 
Posts: 161
Default Automatically displaying text in a form


Hi,

I have a user form that captures information across a set of tabs.

What I would like to do is capture a date entered in one tab and
automatically display this value plus 8 years in a field on a different tab
in the form.

The code I have (embedded into the second tab) is:

Private Sub tb8YO_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)
With Me.tb8YO
.Value = tbDoB.Value.DateAdd("yyyy", 8, .Value)
.Text = Format(.Text, "dd-mmm-yy")
End With
End Sub

I assume that this is assigning the correct value to the text box (I'm not
getting any error messages telling me otherwise), but it is not actually
displaying the value (tbDoB.value plus 8 years) in the text box.

What am I doing wrong?

TIA

Dave