Hello,

I have a form in my VB 6 program which has 6 labels; which are..

Unit 7 Mark:
Unit 8 Mark:
Unit 9 Mark:
Unit 10 Mark:
Unit 13 Mark:
Unit 14 Mark:

To the right of them I have 6 text boxes where the user enters a mark out of 60 for each.

Below all this I have a another text box called, Total Mark, in this all the marks are added together. When the program is run everything works and the marks are added together but only when I hover over the Total Mark text box,

how can i make it update automatically?

Thanks

kindly post the code that you are working on.

txtTotalMark Mouse Move(Event)

txtTotalMark.Text = Val(txtU7Mark.Text) + Val(txtU8Mark.Text) + Val(txtU9Mark.Text) + Val(txtU10Mark.Text) + Val(txtU13Mark.Text) + Val(txtU14Mark.Text)

why not add a command button to the form and add the code in command button click event

because I don't want the user clicking a button to bring up the total, I want it to appear automatically

how you ensure that user does not skip input to any of the 6 text boxes ?

I've got validation in all the other text boxes only allowing numbers, any of the text boxes could be missed out as the students taking the units might not have done them yet, so there wouldnt be a mark

if you are moving form one text box to the other in a sequential order you need to code in the lost_focus event of the textbox.

Thank you, I've put the code behind each of the 6 text boxes in the Lost Focus event, its working fine now

If your problem is solved please mark this thread as solved.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.