Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding Number for invoice

Status
Not open for further replies.

allanmc10

Programmer
Feb 23, 2006
39
GB
i have set up a invoice part to my program, but need to set up a number in my system for the invoice no(automatically)

 
If you are wanting to increment the number each time, then just store the last number used in a file, BD, or registry. When making a new invoice retrieve the last number used, and add 1 to it, then store the NEW last number used.

Becca

Somtimes, the easy answer is the hardest to find. :)

Still under construction ...
 
hi Becca

roughly new to this game any chance of a sample bit of code, to help me on my way

rgrds

allan
 
Writing to a file is probably the simplest way.
Code:
Public invoiceNumber As Int16
    Public invoiceFile As String = System.Windows.Forms.Application.StartupPath & "invoicenumber.txt"

    Public Sub openInvoiceNumber()
        Dim FN As Int16 = FreeFile()
        FileOpen(FN, invoiceFile, OpenMode.Input)
        Input(FN, invoiceNumber)
        FileClose(FN)
    End Sub

    Public Sub saveInvoiceNumber()
        Dim FN As Int16 = FreeFile()
        FileOpen(FN, invoiceFile, OpenMode.Output)
        Write(FN, invoiceNumber)
        FileClose(FN)
    End Sub

Becca

Somtimes, the easy answer is the hardest to find. :)

Still under construction ...
 
Read/Write File: Registry: GUID: And a whole lot of MSDN videos:

barcode_1.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top