Hi I have a bit of a problem I have 4 text boxes one for each number of an lcd displaying the format of tenths, units, tens and hundreds, these count up from a timer and from these boxes they display a relevant figure in the lcd segment structure to form a coherent number.
I have a second console panel with text boxes in them which calculate different prices, tallies and such are calculated but the main thing is the prices and tallies on the console and not the same as the petrol pump itself but they work off the same timer and between the two sections they are only like 5 numbers adrift of each other but still i want them to be the same, here is the code for the main drive of the program.
CODE
Private Sub txtnumber_Change()
Dim Dispensed As Single
Dim Running As Boolean
Dim PriceToPay As Single
Dim Price As Single
Dim Value As Single
Running = True
PriceToPay = txtAmountToPay.Text
Price = (txtPricePerLitre2.Text / 10)
Dispensed = txtnumber.Text
Value = txtPricePerLitre2.Text
If txtPricePerLitre2.Text = 199.9 Then
MsgBox ("Stop! You Have Exceeded The Price Per Litre Limit"), , ("Pumping Limit")
Else
Do While Dispensed = 100 And Running = True
Dispensed = Dispensed + 1
PriceToPay = Val(txtnumber.Text) * Price
Loop
If txtAmountOfLitres.Text = 100 Then
Timer1.Enabled = False
txtnumber.Text = 0
txtAmountOfLitres.Text = txtnumber.Text
Running = False
MsgBox ("You Have Exceeded The Pump Limit"), , ("Pumping Limit Reached")
End If
End If
txtnumber.Text = Format(Dispensed, "000.0")
txtAmountOfLitres.Text = Format(Dispensed, "000.0")
txtAmountToPay.Text = FormatCurrency(Value, "000.0")
txtTallyPetrol.Text = FormatCurrency(PriceToPay / 100, "000.0")