Though it seems to be undocumented now, the old BASIC Name ... As ... syntax
still works in VBA ...
Public Sub TestName()
Name CurrentProject.Path & "\cws.xml" As CurrentProject.Path &
"\renamed.xml"
End Sub
--
Brendan Reynolds
Access MVP
"Roy" <(E-Mail Removed)> wrote in message
news

8044496-9FBF-41AD-BED7-(E-Mail Removed)...
> hi
>
> i export a table from access to a txt file. now i want to rename the file
> with vba code. is that possible??
>
> other solution would be to export the file with the correct name, but i
> dont
> know how to specify the name from a macro
> the file must be named "21042006 150700.txt" ( now() )
>
> any ideas...?
>
> thanks