Solved

Access DB VBA Checks Front-End Location

Posted on 2014-03-19
3
633 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
Comment Utility
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
Comment Utility
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
Comment Utility
Worked fine. Thank yo.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
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…
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …

763 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now