SERIAL PROBLEM

access United States
  • 15 years ago

    I HAVE TWO TABLE ONE FOR EQUIPMENT AND OTHER FOR EQUIPMENTDETAIL
    EQUIPMENT
    EQUIPMENT
    ID        EQUIPMENTNAME
    100001                      PIN
    100002                      RADIO
    100003                      PEN
    EQUIPMENT
    DETAIL
    EQUIPMENTID        TYPEID
    100001                      1
    100001                      2
    100001                      3
    100002                      1
    100002                      2
    100003                      1


    HOW CAN I DO IT BY PROGRAMMING I DOI TIN THIS WAY
    I PIT IT ON THE TYPEID IN THE EQUIPMENTDETAIL FORM
    TYPE_ID DEFAULT VALUE= nextEQUTYPE()


    Public Function nextEQUTYPE()


    nextEQUTYPE = DLookup("TYPEID", "EQUIPMENTDETAIL", "EQUIPMENTID=" & "[EQUIPMENTID]")
    If IsNull(nextEQUTYPE) Then
    nextEQUTYPE = "0001"
    Else
    nextEQUTYPE = DLookup("TYPEID", "EQUIPMENTDETAIL", "EQUIPMENTID=" & "[EQUIPMENTID]")
    End If
    End Function
    BUT IT ALWAY START WITH 1
    SO WHAT IS THE PROBLEM
    THANKS FOR HELPING

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“There are only 3 numbers of interest to a computer scientist: 1, 0 and infinity”