+ Reply to Thread
Results 1 to 4 of 4

Creating a unique ID number based on date and time

  1. #1
    WillRn
    Guest

    Creating a unique ID number based on date and time

    I have a question that I think might be fairly simple to answer.

    I have the following line of code to create a fairly unique ID number for a
    spreadsheet that tracks follow up issues. It is as follows:

    FollowUpInitial.EventID.Value = CMTAudit.AcctNumberTxt.Value & "-" _
    & CMTAudit.EventCode.Value & "-" & _
    Format(CMTAudit.AuditDateTxt.Value, vbLongTime)

    The "AccountNumberTxt.Value" is unique to each patient visit but not to time
    or date.
    The "EventCode.Value" identifies the type of issue that we are tracking.
    The "AuditDateTxt.Value" puts in the current date the issue was found.

    The ID Number then looks like this: 123456-NPSG1a-38440

    However, I can have multiple occurances of the same issue on the same
    account and the same date and this creates duplicates in the ID number. Can
    I insert as a number (sort of like the date, i.e. 5 digits) the value for the
    current time to the second? I have tried simply this:

    FollowUpInitial.EventID.Value = CMTAudit.AcctNumberTxt.Value & "-" _
    & CMTAudit.EventCode.Value & "-" & Time

    But I keep getting: 123456-NPSG1a-09:54:06

    While this could work for my identifier, I would prefer just a 5 or 6 digit
    number.

    Is this possible?



  2. #2
    Tom Ogilvy
    Guest

    Re: Creating a unique ID number based on date and time

    FollowUpInitial.EventID.Value = CMTAudit.AcctNumberTxt.Value & "-" _
    & CMTAudit.EventCode.Value & "-" & format(Time,"hhmmss")


    --
    Regards,
    Tom Ogilvy

    "WillRn" <[email protected]> wrote in message
    news:[email protected]...
    > I have a question that I think might be fairly simple to answer.
    >
    > I have the following line of code to create a fairly unique ID number for

    a
    > spreadsheet that tracks follow up issues. It is as follows:
    >
    > FollowUpInitial.EventID.Value = CMTAudit.AcctNumberTxt.Value & "-" _
    > & CMTAudit.EventCode.Value & "-" & _
    > Format(CMTAudit.AuditDateTxt.Value, vbLongTime)
    >
    > The "AccountNumberTxt.Value" is unique to each patient visit but not to

    time
    > or date.
    > The "EventCode.Value" identifies the type of issue that we are tracking.
    > The "AuditDateTxt.Value" puts in the current date the issue was found.
    >
    > The ID Number then looks like this: 123456-NPSG1a-38440
    >
    > However, I can have multiple occurances of the same issue on the same
    > account and the same date and this creates duplicates in the ID number.

    Can
    > I insert as a number (sort of like the date, i.e. 5 digits) the value for

    the
    > current time to the second? I have tried simply this:
    >
    > FollowUpInitial.EventID.Value = CMTAudit.AcctNumberTxt.Value & "-" _
    > & CMTAudit.EventCode.Value & "-" & Time
    >
    > But I keep getting: 123456-NPSG1a-09:54:06
    >
    > While this could work for my identifier, I would prefer just a 5 or 6

    digit
    > number.
    >
    > Is this possible?
    >
    >




  3. #3
    WillRn
    Guest

    Re: Creating a unique ID number based on date and time

    Thanks Tom, works great!

    "Tom Ogilvy" wrote:

    > FollowUpInitial.EventID.Value = CMTAudit.AcctNumberTxt.Value & "-" _
    > & CMTAudit.EventCode.Value & "-" & format(Time,"hhmmss")
    >
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    > "WillRn" <[email protected]> wrote in message
    > news:[email protected]...
    > > I have a question that I think might be fairly simple to answer.
    > >
    > > I have the following line of code to create a fairly unique ID number for

    > a
    > > spreadsheet that tracks follow up issues. It is as follows:
    > >
    > > FollowUpInitial.EventID.Value = CMTAudit.AcctNumberTxt.Value & "-" _
    > > & CMTAudit.EventCode.Value & "-" & _
    > > Format(CMTAudit.AuditDateTxt.Value, vbLongTime)
    > >
    > > The "AccountNumberTxt.Value" is unique to each patient visit but not to

    > time
    > > or date.
    > > The "EventCode.Value" identifies the type of issue that we are tracking.
    > > The "AuditDateTxt.Value" puts in the current date the issue was found.
    > >
    > > The ID Number then looks like this: 123456-NPSG1a-38440
    > >
    > > However, I can have multiple occurances of the same issue on the same
    > > account and the same date and this creates duplicates in the ID number.

    > Can
    > > I insert as a number (sort of like the date, i.e. 5 digits) the value for

    > the
    > > current time to the second? I have tried simply this:
    > >
    > > FollowUpInitial.EventID.Value = CMTAudit.AcctNumberTxt.Value & "-" _
    > > & CMTAudit.EventCode.Value & "-" & Time
    > >
    > > But I keep getting: 123456-NPSG1a-09:54:06
    > >
    > > While this could work for my identifier, I would prefer just a 5 or 6

    > digit
    > > number.
    > >
    > > Is this possible?
    > >
    > >

    >
    >
    >


  4. #4
    Chris [MSFT]
    Guest

    Re: Creating a unique ID number based on date and time

    Hi WillRn,
    I'm an editor on a new Microsoft site that will aim to help healthcare
    professionals with Office tasks. I'm interested in some of the projects
    you're discussing. Would you be willing to share more information? If you'd
    prefer to discuss off the the thread, e-mail me at [email protected]

    Thanks
    Chris Norred
    Tools For Your Job
    www.microsoft.com/occupations


    "WillRn" wrote:

    > Thanks Tom, works great!
    >
    > "Tom Ogilvy" wrote:
    >
    > > FollowUpInitial.EventID.Value = CMTAudit.AcctNumberTxt.Value & "-" _
    > > & CMTAudit.EventCode.Value & "-" & format(Time,"hhmmss")
    > >
    > >
    > > --
    > > Regards,
    > > Tom Ogilvy
    > >
    > > "WillRn" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > I have a question that I think might be fairly simple to answer.
    > > >
    > > > I have the following line of code to create a fairly unique ID number for

    > > a
    > > > spreadsheet that tracks follow up issues. It is as follows:
    > > >
    > > > FollowUpInitial.EventID.Value = CMTAudit.AcctNumberTxt.Value & "-" _
    > > > & CMTAudit.EventCode.Value & "-" & _
    > > > Format(CMTAudit.AuditDateTxt.Value, vbLongTime)
    > > >
    > > > The "AccountNumberTxt.Value" is unique to each patient visit but not to

    > > time
    > > > or date.
    > > > The "EventCode.Value" identifies the type of issue that we are tracking.
    > > > The "AuditDateTxt.Value" puts in the current date the issue was found.
    > > >
    > > > The ID Number then looks like this: 123456-NPSG1a-38440
    > > >
    > > > However, I can have multiple occurances of the same issue on the same
    > > > account and the same date and this creates duplicates in the ID number.

    > > Can
    > > > I insert as a number (sort of like the date, i.e. 5 digits) the value for

    > > the
    > > > current time to the second? I have tried simply this:
    > > >
    > > > FollowUpInitial.EventID.Value = CMTAudit.AcctNumberTxt.Value & "-" _
    > > > & CMTAudit.EventCode.Value & "-" & Time
    > > >
    > > > But I keep getting: 123456-NPSG1a-09:54:06
    > > >
    > > > While this could work for my identifier, I would prefer just a 5 or 6

    > > digit
    > > > number.
    > > >
    > > > Is this possible?
    > > >
    > > >

    > >
    > >
    > >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1