Creating a unique ID number based on date and time
- From: WillRn <WillRn@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 25 Apr 2005 08:11:05 -0700
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?
.
- Follow-Ups:
- Re: Creating a unique ID number based on date and time
- From: Tom Ogilvy
- Re: Creating a unique ID number based on date and time
- Prev by Date: Re: I was Asked an Interesting Question
- Next by Date: INSERTING A PICTURE ON WORKSHEET
- Previous by thread: Multisheet IF Function
- Next by thread: Re: Creating a unique ID number based on date and time
- Index(es):
Relevant Pages
|