Results 1 to 2 of 2

Thread: Please help me for a simple count

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2002
    Location
    Sri Lanka
    Posts
    9

    Please help me for a simple count

    how can i add a count like this
    eg:- there is a five digit no in the table field ,
    when form loads the five digit no has to add(+) a nother one then 00001+1=00002

    eg Code:-

    strlastno = rstserial.Fields("LastNo")
    strlastno = Val(strlastno) + Val(1)

    from this statement it has to done upto 00009 then after this cant be done


    after that five digit number come to 00009 then
    it will be generate a error dulicating the database

    how can i do this count

    pleace help me

  2. #2
    khalik
    Guest
    if u r generating max key.. and if ur app is single user app then follow this

    Code:
    Dim st As String
    Dim i As Integer
    st = "00001"
    i = Val(st) + 1
    st = String(5 - Len(CStr(i)), "0") & 1
    MsgBox st
    but prefer doing with database

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width