LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default Direct manipulation of TextBox

This is a simplified version of my code. Basically, I have a function
which takes a source string, does some manipulation, passes back a
target (result) string, and sets the function return to true or false
bases on certain conditions

Function a_test(sSource As String, sTarget As String) As Boolean

sTarget = Left(sSource, 1)
a_test = True

End Function



The workings of the function are not important. What I am doing is
calling this on the exit of one textbox to populate another textbox on a
UserForm


Now doing this will not work

Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Dim x As Boolean
x = a_test(TextBox1, TextBox2)
End Sub


I have to use an intermediate variable instead

Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Dim x As Boolean
Dim y as String
x = a_test(TextBox1, y)
TextBox2 = y
End Sub


I tried the first method with .Value and .Text and these didn't work.
Surely if textboxes are read/write I can manipulate them directly...or
can I?
--
Mike
 
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
Direct Formula Rechie Excel Discussion (Misc queries) 7 October 20th 09 10:48 AM
Calculate Textbox value based on another textbox value.doc Tdungate Excel Discussion (Misc queries) 1 February 12th 09 07:11 PM
Calculate Textbox value based on another textbox value Tdungate Excel Discussion (Misc queries) 0 February 12th 09 07:03 PM
Can you direct me. Baha Excel Discussion (Misc queries) 3 June 22nd 07 08:56 AM
Direct reference Archana Excel Worksheet Functions 1 August 31st 06 07:44 AM


All times are GMT +1. The time now is 01:52 AM.

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

About Us

"It's about Microsoft Excel"