how to group records in a file

hi,
I have records like this

D127@dm.com,127,569,BRAD,25/08/2009 23:59
D127@dm.com,127,569,BRAD,25/08/2009 23:59
D159@dm.com,159,1170,DAVE,25/08/2009 23:59
D159@dm.com,159,1181,HALE,25/08/2009 23:59
D393@dm.com,393,1209,CAPIT,25/08/2009 23:59
D457@dm.com,457,571,NORTT,25/08/2009 23:59
D460@dm.com,460,4184,OKEEC,25/08/2009 23:59

I want to group records like this into different files

D127@dm.com
-----------
D127@dm.com,127,569,BRAD,25/08/2009 23:59
D127@dm.com,127,569,BRAD,25/08/2009 23:59

D159@dm.com
-----
D159@dm.com,159,1170,DAVE,25/08/2009 23:59
D159@dm.com,159,1181,HALE,25/08/2009 23:59

D393@dm.com
-----
D393@dm.com,393,1209,CAPIT,25/08/2009 23:59

D457@dm.com
-----
D457@dm.com,457,571,NORTT,25/08/2009 23:59

D460@dm.com
-----
D460@dm.com,460,4184,OKEEC,25/08/2009 23:59

can any one help me on this?

Something like this?

awk -F, 'f!=$1{close(f);f=$1}{print > f}' file

hi franklin,
the solution you gave worked
thanks a lot
can you please explain how it is working

awk -F, 

Set field separator

f!=$1{close(f)

Close file (variable f = filename) if $1 != filename...

f=$1

...and assign new filename to f

{print > f}

print the line to the file

thanks for your reply Franklin