Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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" wrote in message
...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default 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" wrote in message
...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

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" wrote in message
...
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
date formating, creating unique calender Squeeker Excel Worksheet Functions 3 February 28th 10 11:35 PM
Matching call data based on date, time and number called to give c Twiggy Excel Discussion (Misc queries) 1 February 22nd 10 09:26 PM
How can I number rows based on unique values in another column? Carla Excel Worksheet Functions 4 January 7th 10 06:03 AM
Counting unique items based on date DKS Excel Worksheet Functions 19 July 25th 07 10:08 PM
Creating a certain number of entries based on a number in a cell PPV Excel Worksheet Functions 4 June 16th 05 10:25 PM


All times are GMT +1. The time now is 01:49 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"