My MSAccess2007 application was designed with a two-tier folder directory structure. I found that the MS Access2007 did not support (multi-tier folder directories in the install wizard). Searching the forums, I noted the idea to run a batch file to create the lower level folders and move the required files from a top level folder to the preferred multi level folder structure on the initial (first time)start up of the application.
My batch file named "move.bat" works fine pre-packaged from the top level folder. However, it is not working when in the packaged version when testing.
My batch file [move.bat]is
Trying to use Shell("batchfile") method, but when placed in a new module, I get an error saying this is not possible outside of a procedure. When I place in the first start up (Switchboard) OnLoad event, it doesnt seem to run.
Assuming I am going about this in an acceptable way, how (particularly the vba syntax/function needed)and where should I place this code to get the packaged application to run the batch code on initial start up only. ie I do not want the batch file to repeat after the first activation, otherwise the files moved will overwrite user entered data.
From my memory I think MSAccessXP Developer used to allow multi tier folder structures in the packaging wizard, apparently not in MSAccess2007.I realise that I could create a top level folder for my 'templates' in the above, but I would have to go back and change a lot of the code referenced dirctory paths in the application.
Any guidance appreciated.
Deemark
My batch file named "move.bat" works fine pre-packaged from the top level folder. However, it is not working when in the packaged version when testing.
My batch file [move.bat]is
Code:
mkDir Correspondence\CorrespondenceTemplates
mkDir PatientRecords\Templates
Move CorrespondenceTemp\*.* Correspondence\CorrespondenceTemplates
Move PatientRecordsTemp\*.* PatientRecords\Templates
Trying to use Shell("batchfile") method, but when placed in a new module, I get an error saying this is not possible outside of a procedure. When I place in the first start up (Switchboard) OnLoad event, it doesnt seem to run.
Code:
Call Shell(Environ$("COMSPEC") & " /c move.bat",vbNormalFocus
From my memory I think MSAccessXP Developer used to allow multi tier folder structures in the packaging wizard, apparently not in MSAccess2007.I realise that I could create a top level folder for my 'templates' in the above, but I would have to go back and change a lot of the code referenced dirctory paths in the application.
Any guidance appreciated.
Deemark