Solved

Access DB VBA Checks Front-End Location

Posted on 2014-03-19
3
652 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 50

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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Suggested Solutions

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

751 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