Using Equations to Fill in TextBox

O

Orion Cochrane

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?
 
J

Jim Cone

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"
<[email protected]>
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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top