Solved

Cell Value to Textbox Control name

Posted on 2014-04-13
10
317 Views
Last Modified: 2014-04-13
I have a the value Sheet9.tbSig.text stored in Cells(2,7)

I have am using

Public LoggedInUser as String

to store the value in Cells(2,7)


I have the following call to open an Outlook e-mail and fill in all fields.  

Public Sub Mail_Export(ByRef mTO As String, ByRef mCC As String, mSubject As String, mBody As String)

Open in new window


I am using the following all to fill this:

Call OutlookEmail.Mail_Export(cboAssignedTo.Value, Sheet9.tbEPRUpdateCC, "(FOUO) " & cboMember.Text & " EPR Update(FOUO)", Sheet9.tbFOUO.Text & vbCrLf & vbCrLf & Sheet9.tbEPRUpdateBody.Text & vbCrLf & vbCrLf & _
  LoggedInUser   & vbCrLf & vbCrLf & Sheet9.tbFOUO.Text)

Open in new window


When I use the above call for the variable LoggedInUser it uses "sheet9.tbsig1" and not the value of sheet9.tbsig1.

however when I type in the immediate window LoggedInUser = sheet9.tbsig1  the text of tbsig1 is filled into the call procedure.  Any help on how to fix this so the value of the textbox is filled into the call procedure??

Thanks.
0
Comment
Question by:Chrispy2811
  • 5
  • 5
10 Comments
 
LVL 48

Expert Comment

by:Rgonzo1971
ID: 39997187
HI,

Could you show where you assign the value of LoggedInUser   in the code

Regards
0
 
LVL 2

Author Comment

by:Chrispy2811
ID: 39997188
LoggedInUser = Cells(UserIndex, 6)

Open in new window

0
 
LVL 48

Expert Comment

by:Rgonzo1971
ID: 39997189
Hi,

in your question you say it comes from  Cells(2,7)

not Cells(something,6)

is that the problem?

Regards
0
 
LVL 2

Author Comment

by:Chrispy2811
ID: 39997191
No sorry I was just typing it from memory.  it is Cells(UserIndex,7)  
UserIndex is just a placeholder for the row of the currently logged in user.
0
 
LVL 48

Expert Comment

by:Rgonzo1971
ID: 39997199
which result gives this just before the call sub

Debug.Print TypeName(LoggedInUser)
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 2

Author Comment

by:Chrispy2811
ID: 39997203
String
0
 
LVL 48

Expert Comment

by:Rgonzo1971
ID: 39997209
When you type LoggedInUser = sheet9.tbsig1 in the immediate window you assign a textbox
to the variable not a string

then when you Mail_Export sub uses it calls the default propertiy of the object which is in this case .Value

I suppose you have in Cells(UserIndex, 7)  the string "sheet9.tbsig1" that won't work

Regards
0
 
LVL 2

Author Comment

by:Chrispy2811
ID: 39997210
I understand.  I just wanted to know if there was any way to pass the string to a textbox like when I type it into the immediate window?
0
 
LVL 48

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 39997233
Sorry No
0
 
LVL 2

Author Closing Comment

by:Chrispy2811
ID: 39997241
Thanks for the fast response.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now