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?


txtTotalMark Mouse Move(Event)

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

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

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

This question has already been answered. Start a new discussion instead.