Locking down design view

Locopete99

Registered User.
Local time
Today, 05:31
Joined
Jul 11, 2016
Messages
163
Hi All,

I have a user who has discovered design view on my database.

He is a user and so needs to be able to access the database.

Is there a way to lock my Form's in Form view and disable design view until I need to use it?

My Database won't publish into Accde for some reason and I've disabled the menu's but he has found a work around.

Ideally I need a button I can disable design view with and then a passworded button I can enable design view
 
accde is the only way to go if you don't want users to mess with your forms. You cannot disable design view in a .accdb

it wont publish into accde because the code is not compiled.

In the VBA window, put Option Explicit at the top of all modules just below Option Compare Database. Then click the compile option in the debug dropdown. Fix any bugs found until it compiles without error. Then you can publish as .accde
 
ie

you retain the .accdb for development, but release the .accde to users.

it does mean that in case of error, you have a bit more work, as you can't debug one of the released copies.
 
DATABASE ACCEPTABLE USE POLICY:

Password protect the database.
DON'T give him the password until he/she signs an agreement ( like an NDA - including enforceable consequences if broken ).
Advise him to practice his Database Design techniques on NON-PRODUCTION Test databases on his own time.
Roll the NDA out to all users if he/she complains about being singled out.

Sorry, I have no tolerance for malicious users...

Cheers,
Goh
 
Sorry, I have no tolerance for malicious users...

I agree...he's an employee...and he's damaging company property! Warn him (in writing) not to do this again, and if he does, show him the door!

Linq ;0)>
 
OK here's a way to put the fear of Access into the lil varmit:

  1. Create a blank form, name it frm_HDN_FRMPARSE
  2. Set the Timer Interval of the Form to 30000 (= 30 Seconds)
  3. Create an event procedure in the ON_Timer property
  4. Paste the following code into the event

Code:
Option Compare Database
Option Explicit


Private Sub Form_Timer()
On Error GoTo Err_Form_Timer
'   60,000 miliseconds is 1 minute
'   The Timer Interval is now set to check every form
'   Once every 30 seconds (30,000 miliseconds) 120 times an hour


    Dim objAccObj As AccessObject
    Dim objTest As Object
    
    Set objTest = Application.CurrentProject
    
    For Each objAccObj In objTest.AllForms
        
        'Debug.Print objAccObj.Name
        If objAccObj.IsLoaded Then
            If objAccObj.CurrentView = 0 Then
            MsgBox "Get out of DESIGN VIEW " & Environ("UserName") & vbCrLf & vbCrLf & _
            "Date/Time/FormName/Your UserID Have been saved to the DBA's Log for Review"
            With DoCmd
                .Close acForm, objAccObj.Name, acSaveNo
                .OpenForm objAccObj.Name, acNormal
            End With
            
        Else
        End If

    Next objAccObj


Exit_Form_Timer:
    Exit Sub

Err_Form_Timer:
    'Debug.Print Err.Number & " - " & Err.Description
    Resume Next
End Sub

Set an autoexec macro (Macro with the name "AutoExec") to open this form HIDDEN when the database is opened.
Form Name: frm_HDN_FRMPARSE
Data Mode: Read only
Window Mode: Hidden

This little ditty will check every form in your database every 30 seconds to determine if it is open; (If not it just skips to the next); then it checks the view state of the form.

I the form is open in Design View is sends out a little message, (You can edit this one to your liking)

THEN it Closes the form dumping any changes that have been made and reopens the form back into FORM VIEW.

That ought to scare the crap outta him.

You can modify it to delete his saved login and password if you like.

Sorry, couldn't resist...

CHEERS!!
Goh
 
Nice! Great documentation for follow-up actions/proof/evidence.

What sort of organization is involved? Do you have any Info management/Datamanagement policies in place? Might be time to get something set up.
There are stories where people have gotten into areas or done things they were told were violations of company security policy (intellectual property... call it what you will), and have been fired, charged, fined etc. Could be a progression from "bugging you" to modifying/stealing/selling more important company info to 'white collar crime'....
Since you have identified an issue, I recommend you take your concerns to the powers of the organization.

Good luck.
 
Thanks guys for the responses.

I still can't get mine into ACCDE, so instead I unchecked the options to show the menus and ribbon from the settings.

He then found a way around that, so I also used the turn off the ribbon code on the load event of my login screen.

He now can't find a way around it!
 

Users who are viewing this thread

Back
Top Bottom