PC Review


Reply
Thread Tools Rate Thread

Create a folder with Date

 
 
Lamar
Guest
Posts: n/a
 
      28th May 2004
Hello,

When a user hits a cmd button, I want Access to create a
new folder. I want to name the folder to include date and
time the end

i.e. Name the folder: SeaRob526041130 with 52604
meaning 5/26/04 and 1130 meaning 11:30

I know how create new folder but can not add the date and
time. Is this even possible? See VBA code below. Thanks
for any help.

MkDir "C:\HousAuth\" & Left(cmbHA, 3) & Left(cmbESDStaff,
3)
 
Reply With Quote
 
 
 
 
Marshall Barton
Guest
Posts: n/a
 
      28th May 2004
Lamar wrote:

>Hello,
>
>When a user hits a cmd button, I want Access to create a
>new folder. I want to name the folder to include date and
>time the end
>
>i.e. Name the folder: SeaRob526041130 with 52604
>meaning 5/26/04 and 1130 meaning 11:30
>
>I know how create new folder but can not add the date and
>time. Is this even possible? See VBA code below. Thanks
>for any help.
>
>MkDir "C:\HousAuth\" & Left(cmbHA, 3) & Left(cmbESDStaff,
>3)


Use the Format function. e.g.

Format(Now, "mdyyhhnn")
--
Marsh
MVP [MS Access]
 
Reply With Quote
 
Ken Snell
Guest
Posts: n/a
 
      28th May 2004
Assuming that you want the current date and time:

Dim datDateTime As Date
varDateTime = Now()
MkDir "C:\HousAuth\" & Left(cmbHA, 3) & Left(cmbESDStaff, 3) &
Format(varDateTime, "mmddyy") & Format(varDateTime ,"hhnn")


--
Ken Snell
<MS ACCESS MVP>

"Lamar" <(E-Mail Removed)> wrote in message
news:1483001c444e2$19eb1170$(E-Mail Removed)...
> Hello,
>
> When a user hits a cmd button, I want Access to create a
> new folder. I want to name the folder to include date and
> time the end
>
> i.e. Name the folder: SeaRob526041130 with 52604
> meaning 5/26/04 and 1130 meaning 11:30
>
> I know how create new folder but can not add the date and
> time. Is this even possible? See VBA code below. Thanks
> for any help.
>
> MkDir "C:\HousAuth\" & Left(cmbHA, 3) & Left(cmbESDStaff,
> 3)



 
Reply With Quote
 
Michael Hopwood
Guest
Posts: n/a
 
      28th May 2004
MkDir "C:\Date_" & Format(Now(), "yyyymmddhhnn")

--
Michael Hopwood


"Lamar" <(E-Mail Removed)> wrote in message
news:1483001c444e2$19eb1170$(E-Mail Removed)...
> Hello,
>
> When a user hits a cmd button, I want Access to create a
> new folder. I want to name the folder to include date and
> time the end
>
> i.e. Name the folder: SeaRob526041130 with 52604
> meaning 5/26/04 and 1130 meaning 11:30
>
> I know how create new folder but can not add the date and
> time. Is this even possible? See VBA code below. Thanks
> for any help.
>
> MkDir "C:\HousAuth\" & Left(cmbHA, 3) & Left(cmbESDStaff,
> 3)



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Solution to: Can't create file:.xls. Right click folder you want to create the file in and then click properties on the shortcut menu to check your permissions on this folder Ky_fanatic Microsoft Outlook Discussion 1 8th Dec 2006 06:15 PM
Save file in a new folder, but create folder only if folder doesn't already exist? nbaj2k Microsoft Excel Programming 6 11th Aug 2006 08:41 PM
When I try to open/save .rtf attachment I get the messages ?Can't create file. Right-click the folder you want to create item in and then click on the shortcut menu to check your permissions for the folder.? Nie Geweune via AdminLife Microsoft Outlook Installation 2 28th Jun 2006 05:07 PM
How to create a folder using current date as folder name? =?Utf-8?B?TmlnZWwgTGVl?= Microsoft Windows 2000 File System 1 28th Nov 2005 02:23 AM
Re: create folder using date Phil Robyn Microsoft Windows 2000 File System 0 25th Jul 2003 08:20 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:17 PM.