473,406 Members | 2,467 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Calculating text boxes in VB6

104 100+
Hi guys,

I must be the dumb one in these posts. I have 2 simple (2 everyone else out there) questions. I have just started using vb. I am able to use vb in excel with no problem and can code accordingly. I have tried to use the same code in vb6, but obviously it has shown me a big no no! I have read through the threads for the last 2 days, but cannot find these simple answers.

Q1: Simple adding to text boxes together in the form and returning answer in a third box. Using a command button to calculate.

Here is my code:

Private Sub Command1_Click()
Dim Text123 As Integer
Var1 = CDec(Text62.Text)
Var2 = CDec(Text63.Text)
Var3 = CDec(Text64.Text)
var4 = CDec(Text65.Text)
Text123.Text = (Var1 + Var2 + Var3 + var4)
End Sub


Returns : "Invalid qualifier"

Second Q: I have a text box on form 1 and on form 2 - Want to have vb automatically place the result form form 1 (textbox1) to form 2 (textbox1) This result is the calculated result from the previous question. What is this code.

Thanks for anyone whom can help.
Werner
Jul 24 '07 #1
2 2613
pureenhanoi
175 100+
Hi guys,

I must be the dumb one in these posts. I have 2 simple (2 everyone else out there) questions. I have just started using vb. I am able to use vb in excel with no problem and can code accordingly. I have tried to use the same code in vb6, but obviously it has shown me a big no no! I have read through the threads for the last 2 days, but cannot find these simple answers.

Q1: Simple adding to text boxes together in the form and returning answer in a third box. Using a command button to calculate.

Here is my code:

Private Sub Command1_Click()
Dim Text123 As Integer
Var1 = CDec(Text62.Text)
Var2 = CDec(Text63.Text)
Var3 = CDec(Text64.Text)
var4 = CDec(Text65.Text)
Text123.Text = (Var1 + Var2 + Var3 + var4)
End Sub


Returns : "Invalid qualifier"

Second Q: I have a text box on form 1 and on form 2 - Want to have vb automatically place the result form form 1 (textbox1) to form 2 (textbox1) This result is the calculated result from the previous question. What is this code.

Thanks for anyone whom can help.
Werner
+ The first Q, Text123 is a variable, not an object. So, u cannot write :
Text123.Text = anything
If u already have a textbox named Text123, so remove line
Dim Text123 As Integer.
If u havenot already a textbox named Text123, nearly end line must be that
Text123 = (var1+var2+...)
+ The second Q, this is very simple. Insert following line before End Sub line:
From2.TextBox1 = Text123
Jul 24 '07 #2
Wernerh
104 100+
Hi Pureenhanoi

You are a star ! Thanks that worked perfectly.

Cheers
Werner
Jul 24 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

25
by: kie | last post by:
hello, i have a table that creates and deletes rows dynamically using createElement, appendChild, removeChild. when i have added the required amount of rows and input my data, i would like to...
9
by: Abby Lee | last post by:
http://www.ncsa.uiuc.edu/Divisions/Admin/reimb.asp There is just too much code to place here. onChange you trigger a function to add the numbers in the the column you entered an amount in...
5
by: RC | last post by:
I have a form with three text boxes on it. I want the third text box to show the total of the values in the other two text boxes. The first box is named: BoxOne and I type the number 2 into it...
2
by: Tim Marshall | last post by:
Wondering if anyone has any suggestions for this. Sometimes in the form reports my users run, a data sheet subform on a main form, with totals in text boxes with calculated controlsources...
1
by: coolguyraj | last post by:
I have a PHP and javascript code to take value from two text boxes and calculate on triggering the "OnBlur" function and display in the third box. The code works fine with one line item,If i have...
1
by: zaiena | last post by:
hi how to calculate the total average for many text boxes values in the same form for example i have three text boxes two in the main form and the last one in the sub form so when the user define...
2
by: dablyz | last post by:
Hi! I was wondering if I could get some more excellent advice from this site. I'm designing a project that ultimately, among other functions, calculates a download time based upon a file size...
4
by: Brian | last post by:
I have a 2000/2002 Access db that I use to collect and store my exercisetime using a form to enter. I wanted to see a summary of the total timefor each exercise so I have a subform that does this....
6
by: jonnyboy | last post by:
Hello, I have an Access application with a number of forms. On opening one particular form, the application will sometimes appear to get stuck in a loop with 'Calculating...' in the status bar for...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.