hi there,
i have some coding for Vb6 as follows
'lets start on vanweight issue
vanweight2 = Val(frmReceipt.lblWeight.Caption)
vanweight = vanweight + vanweight2 'sets weight to add on each time to vanweight
vanleft = (250 - vanweight)
If vanleft < 0 Then
MsgBox ("VAN OVERLOAD"), vbOKOnly + vbExclamation, " Van Capacity Has Been Exceeded"
frmTicket.Show 'takes user back to ticket form
Unload frmReceipt 'unloads receipt form
The problem im having is when the variable "vanleft" is below 0 (in the if statement above)
the message box with VAN OVERLOAD comes up perfectly, however the value of vanleft remains below zero. Im looking for help on how to leave vanleft unchanged if vanleft < 0
for example, a user enters 3 values for weight
50kg
100kg
110kg
the result for vanleft will be (250-50-100-110) vanleft = -10
when vanleft is below 0, i want the last value to be removed. So when a user puts these 3 values in, the message box appears, to say van overload, then the value they LAST input, is removed. and vanleft will only equal 150kg.
please help me, i have spent hours looking at this code :S
thanks in advance