Solved

Access DB VBA Checks Front-End Location

Posted on 2014-03-19
3
648 Views
Last Modified: 2014-03-20
Experts,

I'm having issues with some of the users of a front end copy of a database opening it from the source directory on our network. Which is causing me issues when I want to update the front end DB. I was hoping that someone could provide some VBA that would:
1) check the database directory on open
2) if opened from source directory prompt the user to do a save as and most importantly
3) ensure that they do not save as on a network drive.

Any assistance with this would be very much appreciated.

Thank you
0
Comment
Question by:spaced45
3 Comments
 
LVL 49

Expert Comment

by:Gustav Brock
ID: 39941630
Make the network folder read-only for common users.
Or mark the file itself (open properties) as read-only. That should learn them from not opening the network copy of your file.

/gustav
0
 
LVL 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 500 total points
ID: 39941852
From my iPad, so don't have access to my code, but in my splash form, I have a Timer event (timer interval = 100) that reads something like:

Private Sub OnTimer

    me.TimerInterval = 0

     if intsr(CurrentProject.path, "S:\") <> 0 then
          MsgBox "You cannot run the application from the network drive." & vbcrlf & vbcrlf _
                     & "Copy the file to your hard drive and try again!"
          docmd.quit
    end if

End Sub
0
 
LVL 1

Author Comment

by:spaced45
ID: 39943808
Worked fine. Thank yo.
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question