Page 2 of 2 FirstFirst 12
Results 16 to 20 of 20
  1. #16
    mond007's Avatar
    mond007 is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    May 2010
    Posts
    52
    It's not the Visual Studio code as I have stepped through and look ok.

    Shell("C:\Program Files (x86)\Microsoft Office\Office14\MSACCESS.EXE c:\BP Planning by PT_dept\BP Planning by PT_dept_fe.accdb", vbNormalFocus)

    It is clearly try to launch the Access DB but failing.
    Click image for larger version. 

Name:	Access_error 1.jpg 
Views:	10 
Size:	29.4 KB 
ID:	25960



    I think there must be an internal path in the FE that tells where the BE lives.

    This is now annoying, when it is so close.

    Thanks in advance.

  2. #17
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    I do not understand what you mean by Visual Studio code. Visual Studio is an Integrated Development Environment. What are you using to write your code? Are you using Access? To create the Visual Basic Script, I would probably use Notepad before opening Visual Studio as an editor.

    The code you posted and the screenshot do not relate to each other. Depending on what you are trying to accomplish and which editor you are using will determine the appropriate syntax.

  3. #18
    mond007's Avatar
    mond007 is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    May 2010
    Posts
    52
    Ok so perhaps we are crossed wires here.

    I have an MS Access DB comprising of :

    BP Planning by PT_dept_be.accdb
    BP Planning by PT_dept_fe.accdb

    If I launch the FE by double clicking it works fine. However upon looking at this post the deployment method need to be a bit more comprehensive for multiple users.
    It seems to me that some kind of VB script was needed to "cleverly" Launch the application if not already running.

    For this there are two parts in the code. The part that checks to see if a version of the BP Planning by PT_dept_fe.accdb is running. If not then copy in the latest and run it.

    The code is NOT inside of the MS Access Database. I assumed you meant create some kind of script be it VB Script or application with the above code in it. The only thing I know of which is VB is Visual Studio Express development package. This allows for the creation of a Form1 and I have put the code in the Form_Load part of this stand alone application.

    The messages I am getting popes out whilst executing the following line of code :

    Shell("C:\Program Files (x86)\Microsoft Office\Office14\MSACCESS.EXE c:\BP Planning by PT_dept\BP Planning by PT_dept.accdb", vbNormalFocus)

    It feel somehow I need to get this access FE working from a command line. i.e. from the Start > Cmd etc.
    Either that or what other scripting tools can I use to create the above code.?

    Thanks in advance. ps. Hope that clarifies.

  4. #19
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by mond007 View Post
    ...Planning by PT_dept_fe.accdb is running. If not then copy in the latest and run it...
    It is not checking if an application is running. It is deleting a file on the client machine and replacing it with a copy, regardless of whether it is a Tuesday morning or a Saturday afternoon; regardless of the file being in use or not; regardless of a revision being made on the master file or not.

    The other code is determining if the client machine that is executing the VB Script (not Access or Access VBA) has Access Version 2010 or Access version 2007 installed. After determining the version of Access installed, the VB Script will open the new copy of the FE file.

    The VB Script is not contained within Access or any Access Module. It is to be in a separate file and work autonomously.

  5. #20
    mond007's Avatar
    mond007 is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    May 2010
    Posts
    52
    Ok got it sorted ...

    All works now. I had a hunch that some thing was not quite right when the command line was looking for BP.mdb (see post 16 diagram) .
    The command line was clearly not working. I knew the code well but solution is the following :

    In the SCRIPT, in Visual Studio Express, not MS Access which has the following line of code :

    c:\BP Planning by PT_dept\BP Planning by PT_dept_fe.accdb

    I replaced it with an unbreakable/contiguous path and filename and it all worked fine. Crazy that !!

    c:\BP_Planning_by_PT_dept\BP_Planning_by_PT_dept_f e.accdb (Note the added underscores)

    All users now can just double click the
    BP Planning by PT_dept.exe which launches the MS Access Database.

    Thank you for all you patient. (ps. It's amazing how ms access can
    pernickety)


Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 07-01-2016, 01:13 AM
  2. Replies: 1
    Last Post: 05-11-2016, 08:14 AM
  3. Replies: 4
    Last Post: 01-14-2016, 11:03 AM
  4. Replies: 4
    Last Post: 10-03-2014, 11:57 AM
  5. Replies: 5
    Last Post: 05-27-2013, 09:34 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums