vb.net programming question?

treo600

New member
currently coding a program in vb.net
it is a program where you can fit 3 item into 1 box and any additional 1 be shipped in an envelope
however i am having an issue with the code
it computes total item count 26 correctly as 8 boxes 2 envelopes BUT will not code item count correctly as i have 10 boxes 3 envelopes where as it should only be 10 boxes 0 envelopes
anyways here is the code i have

Dim boxes As Integer
Dim envelopes As Integer
Dim xint As Integer

boxes = Val(Me.TextBox1.Text / 3)
envelopes = Val(TextBox1.Text)
xint = (boxes / 3) - xint
Me.Label4.Text = xint
Me.Label2.Text = boxes

im thinking a small modification will fix it,, greatly appreciated your answers
 
Back
Top