It's better to handle this external, because it's like asking for problems when you copy or rename an file that's in use (if you cán do it, because windows will trigger an error)
I did something similar to this a while ago and I think if memory serves me correctly it would have worked something like;
-db opens and creates a 0 byte file with pre defined name
-when the renaming event occurs control passes to a vb script or similar
-the script recursively checks if the flag file is present or not
-db closes itself and deletes the flag file
-when the script detects that the flag file has gone it renames the db, opens the renamed db and exits.
I know there is probably a more elegant/less crude way of doing it but hey it worked for me
Do you want to make a copy of the opened db and give it another name?
If so, search the forum for the keyword WINZIP and my user name GHUDSON.
Remove the WinZip part of the code and the rest will show you how to copy the current database and place the copy where ever you want and with any file name.
You can not rename the file that you are already in [open]. You would have to do a "File Save As" action to rename the file but Access does not have that option.
You can not rename the file that you are already in [open]. You would have to do a "File Save As" action to rename the file but Access does not have that option.
After landing in this thread after searching the forum, may I toss in for the non-code users such as myself that Access help actually helped with this. Just search for 'rename file' and it walks you through it. I thought I was going to have to live with 'copy of' for the rest of my career. <g>