View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
K Dales[_2_] K Dales[_2_] is offline
external usenet poster
 
Posts: 1,163
Default DateValue Trouble

Use the Format function to format the date to a number, e.g.:
FollowUpInitial.EventID.Value = CMTAudit.AcctNumberTxt.Value & _
Format(DateValue(CMTAudit.AuditDateTxt.Value),"### ##")


"WillRn" wrote:

I am trying to create a unique id number for each line in a spreadsheet by
combining an existing account number and an audit date.

I have been using the following code:

FollowUpInitial.EventID.Value = CMTAudit.AcctNumberTxt.Value & _
DateValue(CMTAudit.AuditDateTxt.Value)

Unfortunately I keep getting the account number and the standard date format
combined. For Example from and account number of 123456 and 3/24/05 I get:

"1234563/24/05"

What I would like is:

"12345638435"

I know that I am overlooking something pretty simple but it eludes me.

WillRn