I do this with date/time variables all the time, specifically for filenames.
Keep in mind Format() returns a string.
So assuming Now() is 02/28/2009 3:15:02AM, gets converted as so:
strVariable = "Format(Now(), "yyyymmddhhmmss")
?strVariable
20090228031502
hth
--
Jack Leach
www.tristatemachine.com
"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)
"Jack Leach" wrote:
> strVar = Format(dateVar, "ddmmyyyy")
>
> --
> Jack Leach
> www.tristatemachine.com
>
> "I haven''t failed, I''ve found ten thousand ways that don''t work."
> -Thomas Edison (1847-1931)
>
>
>
> "Imran Ghani" wrote:
>
> > Hi! Its nice to be among all of you programming genius people. I am working
> > in MS Access2007 with VBA programming. I want to develop a unique id for my
> > records, thereby I need to convert my Date() to the format of "ddmmyyyy" e.g.
> > 17062009, the dd/mm/yyyy format w/o the "/" option. I hav tried many options
> > but still not succeeded. I'd much appreciate if anybody could suggest me the
> > right way to achieve it. Thanks in advance.