Kewl! Found the Format function in MS Help after I posted.
Thanks!
strDateTime = Format(Now(), "mmddyyyyhhnnss") did the trick. :)
Still becoming familiar with VB functions.
> Kewl! Found the Format function in MS Help after I posted.
> Thanks!
> strDateTime = Format(Now(), "mmddyyyyhhnnss") did the trick. :)
>
> Still becoming familiar with VB functions.
There is a distinction that needs to be made here. What I suggested was
using the format *Property*. That gives you the desired display, but the
underlying data is still a date and it will be treated like a date for
sorting and comparisons.
The Format() *Function* which is what you used actually takes the date and
transforms it into a string in the output so now the field will act like a
string when it comes to sorting and comparisons. You have to take this
difference into account when you are choosing between the two methods.
Also, when using a format property the field will still be editable. If you
use the Format() function it will not be.

Signature
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Pamela - 09 Jan 2006 15:40 GMT
That's what I figured...
I knew how to use the format property for fields & controls on forms, it was
the VB code for converting a date & time I was looking for as I needed to use
it to append to the beginning of imported email attachment filenames to make
them unique. Your suggestion led me to look at using format in Visual Basic,
so thanks! :-)
>> Kewl! Found the Format function in MS Help after I posted.
>> Thanks!
[quoted text clipped - 14 lines]
>Also, when using a format property the field will still be editable. If you
>use the Format() function it will not be.