Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2004
    Posts
    4

    Unanswered: Generate ID with Integer and Character type

    Hi,
    can anyone show me the way to generate ID with Integer and Character type?
    like JobID: PA001,PA002,PA003....in database

    Below is my code that only generate number:
    With adoJob.Recordset
    .MoveLast
    JobID = adoVendor.Recordset.Fields(0) + 1
    .AddNew
    txtJobID.Text = vendorID
    MsgBox "Your New Job ID is " & txtJobID.Text
    End With

    ------------------------------------------------------------
    Well, below is my problem that involve alphabet with number
    (It will show "type mismatch" message):

    With adoJob.Recordset
    .MoveLast
    JobID = adoJob.Recordset.Fields(0) + 1
    .AddNew
    txtJobID.Text = "PA00" & vendorID
    MsgBox "Your New Vendor ID is " & txtJobID.Text
    End With

    -------------------------------------------------------------
    i am using ADODC recordset,
    can anyone help me
    thankx


    also anyone know how to set Expression?
    like Numbering System: "CQ/03/002"
    CQ mean company name
    03 mean year 2003
    002 mean Project number
    so if user enter "CQ/00w/wd", it will say invalid expression

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    I think that you need Str() to make the number a string.

    -PatP

Posting Permissions

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