ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Using Equations to Fill in TextBox (https://www.excelbanter.com/excel-programming/430114-using-equations-fill-textbox.html)

Orion Cochrane

Using Equations to Fill in TextBox
 
I have a form for data entry with one field in particular that I want
auto-populated based on values throughout this form. To get this value, I use
the Enter event in the textbox, but I keep getting Type Mismatch errors when
I do txt1.value-txt2.value and so on. Can I sum values from text boxes?
--
I am running on Office 2003, unless otherwise stated.

Jim Cone[_2_]

Using Equations to Fill in TextBox
 
Yes, but the values have to be numeric.
A textbox contains text. <g
Try...

CDbl(txt1.Value) + Val(txt2.Value)

Either CDbl or Val should work.
--
Jim Cone
Portland, Oregon USA



"Orion Cochrane"

wrote in message
I have a form for data entry with one field in particular that I want
auto-populated based on values throughout this form. To get this value, I use
the Enter event in the textbox, but I keep getting Type Mismatch errors when
I do txt1.value-txt2.value and so on. Can I sum values from text boxes?
--
I am running on Office 2003, unless otherwise stated.

Orion Cochrane

Using Equations to Fill in TextBox
 

That worked beautifully. Thanks.
--
I am running on Office 2003, unless otherwise stated.


"Jim Cone" wrote:

Yes, but the values have to be numeric.
A textbox contains text. <g
Try...

CDbl(txt1.Value) + Val(txt2.Value)

Either CDbl or Val should work.
--
Jim Cone
Portland, Oregon USA



"Orion Cochrane"

wrote in message
I have a form for data entry with one field in particular that I want
auto-populated based on values throughout this form. To get this value, I use
the Enter event in the textbox, but I keep getting Type Mismatch errors when
I do txt1.value-txt2.value and so on. Can I sum values from text boxes?
--
I am running on Office 2003, unless otherwise stated.


Jim Cone[_2_]

Using Equations to Fill in TextBox
 

You are welcome and thanks for the update.
'--
Jim Cone




"Orion Cochrane"

wrote in message
That worked beautifully. Thanks.
--
I am running on Office 2003, unless otherwise stated.




"Jim Cone" wrote:
Yes, but the values have to be numeric.
A textbox contains text. <g
Try...
CDbl(txt1.Value) + Val(txt2.Value)
Either CDbl or Val should work.
--
Jim Cone
Portland, Oregon USA







"Orion Cochrane"

wrote in message
I have a form for data entry with one field in particular that I want
auto-populated based on values throughout this form. To get this value, I use
the Enter event in the textbox, but I keep getting Type Mismatch errors when
I do txt1.value-txt2.value and so on. Can I sum values from text boxes?
--
I am running on Office 2003, unless otherwise stated.



All times are GMT +1. The time now is 03:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com