Solved

Cell Value to Textbox Control name

Posted on 2014-04-13
10
320 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:Chris Pfeiffer
  • 5
  • 5
10 Comments
 
LVL 50

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:Chris Pfeiffer
ID: 39997188
LoggedInUser = Cells(UserIndex, 6)

Open in new window

0
 
LVL 50

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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 2

Author Comment

by:Chris Pfeiffer
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 50

Expert Comment

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

Debug.Print TypeName(LoggedInUser)
0
 
LVL 2

Author Comment

by:Chris Pfeiffer
ID: 39997203
String
0
 
LVL 50

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:Chris Pfeiffer
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 50

Accepted Solution

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

Author Closing Comment

by:Chris Pfeiffer
ID: 39997241
Thanks for the fast response.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

828 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