Put the symbol "-" into a unique ID

YNWA

Registered User.
Local time
Today, 13:12
Joined
Jun 2, 2009
Messages
905
Hi,

I generate a unique ID based on numerous fields.

ID number
first name inital
last name inital
first letter of gender
month and year of death

eg. 1(ID)WB(initials)M(gender)01/10(date of death Jan 2010).

Looks like this 1WBM01/10

Thats great, exactly what I need but what I want also is a "-" inserting after the ID, to seperate the uniqueID.

So I want it to look like: 1-WBM01/10

THe code I have already is this...

In control source of hidden form field:
Code:
=UCase([ID] & Left([fldFirstName],1) & Left([fldLastName],1) & Left(cboGender.Column(1),1)) & Format(DLookUp("[fldDateDeath]","tbl_DeathsInfo","[recordID]=" & [ID]),"mm/yy")

Anyone know how to get a hyphen (-) after the ID part?
 
=UCase([ID] & "-" & Left([fldFirstName],1) & Left([fldLastName],1) & Left(cboGender.Column(1),1)) & Format(DLookUp("[fldDateDeath]","tbl_DeathsInfo","[recordID]=" & [ID]),"mm/yy")
 
=UCase([ID] & "-" & Left([fldFirstName],1)...
 
Cheers, I had tried [ID], "-" & Left([

Almost but no cigar.
 
That's because you have a comma after [ID] not an ampersand, as both Chipper and I suggested!

[ID] & "-" & Left(
 
I hope you aren't using this "unique" id as your primary key.
 
I hope you aren't using this "unique" id as your primary key.

Nope, I have a autonumber ID field for that.

The unique ID field I should call something like child reference code.

The format of it they have used for years with the police, social services etc... in paper form.

By putting the ID part at the front, I am in theory stopping it being duplicated as the ID number at the front with never be the same.

The code is then used for reference documents between the child death panel, police, social service and an other agencies that are involved.

Cheers all.
 

Users who are viewing this thread

Back
Top Bottom