vendredi 27 mars 2015

How to add 1 on last data? VB2008

I have written a program and I cannot get part of it to work. My program opens with a welcome page (form). It then moves onto a new page whereby food can be ordered and that quantity, price and total are enteresin in a table with three listboxes.


Once the order is accepted, a receipt form opens. The program then prints the receipt, collapses all the forms with data in, and opens up the welcome page (form) again, thereby returning to the start.


I am trying to add an order number in the receipt form. But because I define the ordernumber as 0 in the form, everytime the program reopens this form, it resets ordernumber to zero. Thus the instruction ordernumber = ordernumber +1 does not keep accumulating.


how to get around this?



pulic ordernumber As Integer = 1
Private Sub Formreceipt_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Lblorn.Text = ordernumbeordernumber = ordernumber + 1
Lblorn.Text = ("Order Number:" & ordernumber)

Aucun commentaire:

Enregistrer un commentaire