Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Packaging MS Access 2007 application with multi tier folders.

Status
Not open for further replies.

DeeMark

Programmer
Feb 10, 2005
15
0
0
GB
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
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
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

 
Update: I have figured out successful operation of the basic batch file in the OnLoad event of the Switchboard, start up to create new directories and move files.
Still trying to figure out how to make this batch file activate only on the first activation of Switchboard Form OnLoad event and not in subsequent uses of the application.
Have been trying a Do... While Counter approach. But not successful.
Any help appreciated.
Deemark

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top