Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Property allowbreakintocode!!!!What is help saying? 1

Status
Not open for further replies.

brucomela

Programmer
Oct 15, 2001
52
0
0
IT
I don't want the user of the project I'm working on to break into code in case of debugs. Access help says it's possible to set this selecting instruments, start, advanced properties, but that's completely false!! Where can I set the property Allowbreakintocode to false (better if without code or macros)?
 
bruco,
It's in Tools-->Startup>>Advanced. 'Allow viewing code after error'
--Jim
 
Sorry jim, but I can't see it there.I can only find "allow special keys", nothing else in that place! Is it normal??!
 
Can't really answer, but I can tell you that brucomela is using ver 2K and JimHorton isn't. Jim's citation is for ver '97 and previous. ver 2K has (aparently) moved it to I know not where.

MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
I am not exactly familiar with this... but from your description, my guess is that you may (or someone else) may have already set some kind of restrictions and thus you can't see some options. Try opening your file with the shift key held down.

 
But are you sure that this is really available on access 2k, in the same position?
 
Try going to tools, start up, and deselecting the options. Make sure to hold down the shift key if you want to go back and select them again.
 
Hi All!

MichaelRed is absolutely correct, for whatever reason, that option is no longer available in StartUp. It can still be set in code though.

hth
Jeff Bridgham
bridgham@purdue.edu
 
ok jebry, tell me something more..I'm a newbie in access, explain me what code I might insert and where please!
 
Here's the code to disable the break into code. You should put it in a module and then call this subroutine from your start up form or an autoexec macro.

Code:
Public Sub StartUp()
Dim prp As Property
    Dim dbs As Database
    On Error Resume Next
    Set dbs = CurrentDb
    dbs.Properties("AllowByPassKey") = False
    If Err.number <> 0 Then
        Set prp = dbs.CreateProperty &quot;AllowByPassKey&quot;,dbBoolean, False)
    dbs.Properties.Append prp
    End If

End Sub

However, as this thread has already hinted, there are numerous other ways for your users to break into your design view. Here's a faq that may help you: faq181-1021. There is also a link in the faq to another faq with more VB coding to lock out users. If you have the time, read the code and try to learn what it does. I've found it immensely helpful. Maq B-)
<insert witty signature here>
 
Hi!

Try this:

Dim dbs As DAO.Database
Dim prp As DAO.Property

Set dbs = CurrentDb
Set prp = dbs.CreateProperty(&quot;AllowBreakIntoCode&quot;, dbBoolean, False)

dbs.Properties.Append prp
dbs.Properties(prp.Name) = False

Set prp = Nothing
Set dbs = Nothing

Technically the line dbs.Properties(prp.Name) = False is unnecessary, but I've had times when it would not work without it. You can put this code in the click event of a button and then run it that way. You will need to close the database and reopen it before the new property value takes effect.

hth
Jeff Bridgham
bridgham@purdue.edu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top