I've a field, say "Invoice No.", i want to be this as an auto-generated number.
like DLP/001/2013-2014 DLP/002/2013-2014 DLP/003/2013-2014 .
I use vb6 and Access.how can i do this?


I don't recomended to make autonumber to an Id like this but you can split it.
Get the Last Invoice number from database and Split it by "/". Extract the second value in array and you will get the existing invoice num. Add it by 1 and there are new Invoice Num.
Ex :

Private Sub InvoiceNum()
    Set rs = New ADODB.Recordset
    ' Select last row data using MAX() function
    rs.Open "SELECT max(Id)from Address", Conn, adOpenDynamic, adLockBatchOptimistic

    Dim temp() As String
    temp = Split(rs.Fields(0), "/") 'Split data by "/" sign
    ' temp (0) will contain DLP
    ' temp (1) will contain 003
    ' temp (2) will contain 2013-2014

    MsgBox "DLP/00" & temp(1) + 1 & "/2013-2014" ' Show new invoice number 
End Sub
This question has already been answered. Start a new discussion instead.