Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default How to feed a userform a variable to display in a textbox?

On Feb 1, 6:34*am, "Nigel" wrote:
Try moving the code to the UserForm initialize event.....

--

Regards,
Nigel


"Chet" wrote in message

...



I am trying to feed or supply a userform text box a variable which I
have assigned in my main code module. *I am having a problem getting
the variable data to display in the userform when I show the user
form. *A blank userform text box shows up instead. *I'm doing
something wrong. *Here is what I did.


1. Created the variable FormTextToShow in my main code module and
named it as a Public variable.


FormTextToShow = "Program will run for location " & Location & " for
month of " & MonthAlpha & " " & TargetYear


2. I have the following code in my "form module". *Textbox3 is the
variable that should be feeding the textbox.


Private Sub CommandButton1_Click()
* *TextBox3.Value = FormTextToShow
* *TextString1 = TextBox3.Text
* *PrelimStatus = OptionButton1.Value
* *FinalStatus = OptionButton2.Value
* *MinMinutesToKeep = TextBox2.Text
* *FilterOut = CheckBox1.Value
* *SaveToDesktop2 = OptionButton3.Value
* *SaveToMyDocs2 = OptionButton7.Value
* *SaveToFltSched = OptionButton8.Value
* *SaveToGeneral = OptionButton4.Value
* *SaveNo = OptionButton6.Value
* *Unload FltSchedAnalysis
End Sub


Possibly i am doing it in the wrong sequence or section of code.
Where should I put the code you mentioned?


The problem is when I run the main code and the variable
FormTextToShow does not show up. *I just get a blank
textbox showing up on my form. *(I did do a step-through it test and
ran the code and the FormTextToShow variable did show up then in my
textbox3.) * My idea is to show the user what data the program will be
running in the userform so I'm actually "feeding" the user form.


What am I doing wrong? * Thx *much... Chet- Hide quoted text -


- Show quoted text -


That did the trick!.. Thank you .. . Chet
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
userform textbox to variable Peter[_61_] Excel Programming 2 July 18th 07 11:50 AM
Userform textbox help [email protected] Excel Programming 0 September 16th 06 10:57 PM
Qn: Display Text in TextBox in Userform Michael Vaughan Excel Programming 1 August 18th 04 05:06 PM
Textbox in userform shaharul[_6_] Excel Programming 3 April 15th 04 12:54 PM
UserForm TextBox to ActiveSheet TextBox over 256 characters Dan E[_2_] Excel Programming 1 July 28th 03 07:36 PM


All times are GMT +1. The time now is 12:34 PM.

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"