rename current database
rename current database
(OP)
hi every body
how can i rename my current database after close it automaticly with vba code
how can i rename my current database after close it automaticly with vba code
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS Contact USThanks. We have received your request and will respond promptly. Come Join Us!Are you a
Computer / IT professional? Join Tek-Tips Forums!
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail. Posting Guidelines |
rename current database
|
rename current databaserename current database(OP)
hi every body
how can i rename my current database after close it automaticly with vba code Red Flag SubmittedThank you for helping keep Tek-Tips Forums free from inappropriate posts. Reply To This ThreadPosting in the Tek-Tips forums is a member-only feature.Click Here to join Tek-Tips and talk with other members! Already a Member? Login |
Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.
Here's Why Members Love Tek-Tips Forums:
Register now while it's still free!
Already a member? Close this window and log in.
RE: rename current database
Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
RE: rename current database
RE: rename current database
Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
RE: rename current database
---- Andy
"Hmm...they have the internet on computers now"--Homer Simpson
RE: rename current database
The file whose name is to be changed must be closed first, then another file can be opened through which the name can be changed.... Is there no other way?
RE: rename current database
Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
RE: rename current database
RE: rename current database
Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
RE: rename current database
RE: rename current database
Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
RE: rename current database
Was the file 'not in use' any more? Not used by any other process?
---- Andy
"Hmm...they have the internet on computers now"--Homer Simpson
RE: rename current database
CODE
---- Andy
"Hmm...they have the internet on computers now"--Homer Simpson
RE: rename current database
I believe the OP wants to rename the current Access file which can't be done while the file is open.
Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
RE: rename current database
1- Name "File path and name without extension" As "File path and name with extension "
2- Call OpenAccessDatabase("File path and name with extension ")
All I want is when I close this file, its name, location, and extension are changed so as not to steal it
I tried this code in the file closing event and the requested change did not occur
1- Docmd.quit
2- Name "File path and name with extension" As "File path and name without extension "
I tried to open the bat file after closing the access file, and it contains instructions to change the name and extension of the access file, but nothing was changed either... as shown.
1- Docmd.quit
2- Dim myPath As String
3- myPath = "file path\filename.bat"
4- Call Shell(myPath, 1)
RE: rename current database
Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
RE: rename current database
What I don't get is: "extension are changed so as not to steal it"
Who is going to steal your file from your hard drive
---- Andy
"Hmm...they have the internet on computers now"--Homer Simpson
RE: rename current database
RE: rename current database
Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
RE: rename current database
Code (in Excel, but can be any application that supports VBA), required reference to Access library:
CODE -->
combo
RE: rename current database
Could these 2 lines:
CODE
CODE
Dim AccessApp As New Access.Application
---- Andy
"Hmm...they have the internet on computers now"--Homer Simpson
RE: rename current database
Anyway, I will simplify things so that my goals become clear
On my desktop, I have two Access files, file A has no extension, and file B has the extension. All I want is him
1- Open file B through file A after changing its extension.
2- When you close file A, its extension is changed to no extension (automatically) to become as it was.
Is this possible or impossible?
RE: rename current database
combo
RE: rename current database
CODE --> RunRename.cmd
The code will change to the appropriate directory, rename the Access file, run the Access file, wait until the user exits the Access file, and renames the Access file.
Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
RE: rename current database
It was a very perfect solution and exactly what I wanted.. Thank you very much.
RE: rename current database
For example "file not found" error
RE: rename current database
Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
RE: rename current database
RE: rename current database
Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
RE: rename current database
RE: rename current database
combo
RE: rename current database
The key was in the Save event, as I recall, to make the application appear to have only ONE useless sheet while all other sheets were very hidden. If the user ENABLED MACROS, the very hidden sheets were made visible. When the application would close, it would make all sheets but one very hidden before saving and closing. Didn't matter where it was saved.
Well one weak spot was that although the VBA was password protected, that could be cracked.
With user-friendly DIY applications like Access or Excel, they are thus vulnerable to tampering. You need an executable to distribute, that you generate from your personal master.
Skip,
Just traded in my OLD subtlety...
for a NUance!
"The most incomprehensible thing about the universe is that it is comprehensible" A. Einstein
You Matter...
unless you multiply yourself by the speed of light squared, then...
You Energy!