[AccessD] A2003: rename a file via vba

Darren DICK d.dick at uws.edu.au
Thu Dec 16 21:09:59 CST 2004


 
Hi Stuart
Many thanks
When I copy and paste the line below it errors, then goes red and tells me
it is expecting
Compile Error: Expected: As
The Compiler then goes to the space after the first "C:\mydB.mdb"

Any thoughts??

Darren


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan
Sent: Friday, 17 December 2004 1:42 PM
To: Access Developers discussion and problemsolving
Subject: Re: [AccessD] A2003: rename a file via vba

On 17 Dec 2004 at 12:40, Darren DICK wrote:

> Hello all
> Any suggestion on renaming a file via code PSEUDO CODE EXAMPLE
> 
> Some thing like
> Call Rename "C:\mydB.mdb", "C:\mydb" & "_" & Format(Date,"dd/mm/yyyy") 
> & ".mdb"
> 

The "Name" command has been part of VBA since the year dot and was part of
most flavours of Basic since the very early days. Just use:

Name "C:\mydB.mdb"  "C:\mydb" & "_" & Format(Date,"dd/mm/yyyy") & ".mdb"



--
Stuart


-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list