Getting rid of edit box thing

yhgtbfk

Registered User.
Local time
Tomorrow, 08:10
Joined
Aug 30, 2004
Messages
123
When you open a form, go to design view, right click on a control, and click properties, you see and edit box thing.

With this edit box, you can do all sorts of damage, such as changing VB code, or resizing controls.

How can I turn this off using VB?

I have disabled right click, but here is a trick:

Open up any access database you have full use of, open up the edit box thingo, then close the database fully.

When you open up a "protected" database, the edit box thingy opens up cos it was open when you last were using access.

By protected I mean I have disabled
database window
status bar
built in toolbars
full menus
break into code
default short cut menus
toolbar/menu changes
shift key bypass
special keys

Please help
 
y,

You can always distribute a .MDE file to the users. They won't be able
to muck with the forms/code etc.

Wayne
 
This "feature" is both a blessing and a curse. It is quite helpful when you are still developing because it allows you to make some property changes while the form is open which allows you to immediately see the effect. However, once you're done and you want to distribute the app, you would like to turn off the "feature". There isn't any global way that I have found, although you could write a function to open each form and turn the property off.

To do it manually, open the form in design view and change the "Allow Design Changes" property to "Design View Only".
 
John Mishefske gets the credit for this...

Code:
Public Sub AllowDesignChangesOff()

    Dim db As DAO.Database
    Dim i As Integer
    Dim contr As Container, frm As Form
   
    On Error GoTo HandleErr

    Set db = CurrentDb
    Set contr = db.Containers("Forms")
    
    For i = 0 To contr.Documents.Count - 1
        Debug.Print contr(i).name
        DoCmd.OpenForm contr(i).name, acDesign
        Set frm = Forms(contr(i).name)
        frm.[COLOR=Blue]AllowDesignChanges[/COLOR] = False
        'frm.PopUp = False
        DoCmd.Close acForm, contr(i).name, acSaveYes
    Next i
    
    Set frm = Nothing
    Set contr = Nothing
    Set db = Nothing

ExitHere:
    On Error Resume Next
    Exit Sub

HandleErr:
    Debug.Print Error$
    Resume ExitHere

End Sub
 
WayneRyan said:
Y,

Pat's not a guy ...

But G's the MAN ...

Wayne

Well I didnt know that, but in my defence:

In the Italian langauge, if you have many female children it is

Bambine

If you have many male children it is

Bambini

But if you have a mixture, you still use

Bambini

So "guys" for all males
"girls" for all females

"Guys" for a mixture...

What? You arent buying it? OK, so I thought he was a guy...Sorry
 
y,

Not a problem. It's just that everyone seems to keep calling Pat a guy.
I just don't want her to "loose" her identity.

Wayne
 

Users who are viewing this thread

Back
Top Bottom