Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Automatically displaying text in a form


Dave, try

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


If this post helps click Yes
---------------
Jacob Skaria


"Risky Dave" wrote:

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Automatically displaying text in a form


Correction..

Me.tb8YO.Text =Format(DateAdd("yyyy",8,Me.tbDoB),"dd-mmm-yy")

If this post helps click Yes
---------------
Jacob Skaria


"Jacob Skaria" wrote:

Dave, try

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


If this post helps click Yes
---------------
Jacob Skaria


"Risky Dave" wrote:

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 161
Default Automatically displaying text in a form


Jacob,

Thanks for the quick reply. unfortunately, this still isn't working - the
field that should show the date plus 8 years is still blank :-(

"Jacob Skaria" wrote:

Correction..

Me.tb8YO.Text =Format(DateAdd("yyyy",8,Me.tbDoB),"dd-mmm-yy")

If this post helps click Yes
---------------
Jacob Skaria


"Jacob Skaria" wrote:

Dave, try

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


If this post helps click Yes
---------------
Jacob Skaria


"Risky Dave" wrote:

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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Automatically displaying text in a form


1. Check whether this code is getting executed. Place a msgbox and check. I
dont think the code is getting executed; or otherwise it should have given an
error in the first place.

2. Check whether the control names are correct tb8YO.

If this post helps click Yes
---------------
Jacob Skaria


"Risky Dave" wrote:

Jacob,

Thanks for the quick reply. unfortunately, this still isn't working - the
field that should show the date plus 8 years is still blank :-(

"Jacob Skaria" wrote:

Correction..

Me.tb8YO.Text =Format(DateAdd("yyyy",8,Me.tbDoB),"dd-mmm-yy")

If this post helps click Yes
---------------
Jacob Skaria


"Jacob Skaria" wrote:

Dave, try

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


If this post helps click Yes
---------------
Jacob Skaria


"Risky Dave" wrote:

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



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Automatically displaying text in a form


Where is your TextBox located at... on the worksheet or on a UserForm?

--
Rick (MVP - Excel)


"Risky Dave" wrote in message
...
Jacob,

Thanks for the quick reply. unfortunately, this still isn't working - the
field that should show the date plus 8 years is still blank :-(

"Jacob Skaria" wrote:

Correction..

Me.tb8YO.Text =Format(DateAdd("yyyy",8,Me.tbDoB),"dd-mmm-yy")

If this post helps click Yes
---------------
Jacob Skaria


"Jacob Skaria" wrote:

Dave, try

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


If this post helps click Yes
---------------
Jacob Skaria


"Risky Dave" wrote:

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


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 161
Default Automatically displaying text in a form

Rick the text box is on a user form called from a worksheet by the user
selecting a button.

What I am trying to do is have a field on one tab on the form automatically
populated by a user entry into another text box on a different tab on the form

TIA

Dave

"Rick Rothstein" wrote:

Where is your TextBox located at... on the worksheet or on a UserForm?

--
Rick (MVP - Excel)


"Risky Dave" wrote in message
...
Jacob,

Thanks for the quick reply. unfortunately, this still isn't working - the
field that should show the date plus 8 years is still blank :-(

"Jacob Skaria" wrote:

Correction..

Me.tb8YO.Text =Format(DateAdd("yyyy",8,Me.tbDoB),"dd-mmm-yy")

If this post helps click Yes
---------------
Jacob Skaria


"Jacob Skaria" wrote:

Dave, try

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


If this post helps click Yes
---------------
Jacob Skaria


"Risky Dave" wrote:

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



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 161
Default Automatically displaying text in a form

Guys,

Just realised I was being stupid!

I was trying to get one txt box to identify a chnage in state in another
one. What I've done is simply have the source (tbDoB) textbox run a couple of
lines to drop the appropriate information into the target textbox (tb8YO)
after an Update Event.

Thanks for your time anyway,

Dave

"Rick Rothstein" wrote:

Where is your TextBox located at... on the worksheet or on a UserForm?

--
Rick (MVP - Excel)


"Risky Dave" wrote in message
...
Jacob,

Thanks for the quick reply. unfortunately, this still isn't working - the
field that should show the date plus 8 years is still blank :-(

"Jacob Skaria" wrote:

Correction..

Me.tb8YO.Text =Format(DateAdd("yyyy",8,Me.tbDoB),"dd-mmm-yy")

If this post helps click Yes
---------------
Jacob Skaria


"Jacob Skaria" wrote:

Dave, try

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


If this post helps click Yes
---------------
Jacob Skaria


"Risky Dave" wrote:

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



  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Automatically displaying text in a form


When you say "tab on the form", are you using a MultiPage or a TabStrip
control (or perhaps something else) to hold your TextBoxes?

--
Rick (MVP - Excel)


"Risky Dave" wrote in message
...
Rick the text box is on a user form called from a worksheet by the user
selecting a button.

What I am trying to do is have a field on one tab on the form
automatically
populated by a user entry into another text box on a different tab on the
form

TIA

Dave

"Rick Rothstein" wrote:

Where is your TextBox located at... on the worksheet or on a UserForm?

--
Rick (MVP - Excel)


"Risky Dave" wrote in message
...
Jacob,

Thanks for the quick reply. unfortunately, this still isn't working -
the
field that should show the date plus 8 years is still blank :-(

"Jacob Skaria" wrote:

Correction..

Me.tb8YO.Text =Format(DateAdd("yyyy",8,Me.tbDoB),"dd-mmm-yy")

If this post helps click Yes
---------------
Jacob Skaria


"Jacob Skaria" wrote:

Dave, try

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


If this post helps click Yes
---------------
Jacob Skaria


"Risky Dave" wrote:

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




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Displaying Text on a Forms 2 Form Alan Forsyth Excel Programming 2 December 28th 07 03:24 PM
Disable help from automatically displaying rdavia Excel Discussion (Misc queries) 0 February 15th 06 07:19 PM
In Excel how can a number automatically display in text form Curtis A Excel Worksheet Functions 2 February 26th 05 11:31 AM
displaying info on a form JT[_2_] Excel Programming 1 February 3rd 05 09:49 PM
Displaying form on startup? PEno1 Excel Programming 2 December 6th 04 02:09 AM


All times are GMT +1. The time now is 04:34 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"