Solved

Access DB VBA Checks Front-End Location

Posted on 2014-03-19
3
655 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 51

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 48

Accepted Solution

by:
Dale Fye 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

Office 365 Training for IT Pros

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

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

This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
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 …
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.
Suggested Courses
Course of the Month3 days, 21 hours left to enroll

630 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