ameedoo3000
IS-IT--Management
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
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
How did you do it? What did you try? Code sample would be nice to see.ameedoo3000 said:I already did this [rename the file?] through another Access file and the name was not changed
Private Sub RenameFile()
Dim strPath As String
Dim strOrgFile As String
Dim strNewFile As String
strPath = "C:\SomeFolder\"
strOrgFile = "MyFile.txt"
strNewFile = "NewFileName.xyz"
[blue]
Name [/blue]strPath & strOrgFile [blue]As[/blue] strPath & strNewFile
End Sub
So why not run it directly from hidden place?ameedoo3000 said:I save it on the hard disk without an extension, so as not to steal it on it, and when I want to use it
Sub OpenAccessDB()
Dim AccessApp As Access.Application
Set AccessApp = New Access.Application
With AccessApp
.Visible = True
.OpenCurrentDatabase "Path_and_database_name_here"
End With
Set AccessApp = Nothing
End Sub