Hide Database window

F

Frank B

Before creating an MDE, I can set Startup to hide the
Database window. Then create the MDE. But, when the MDE
is running you can press F11 and it pops-up. I don't want
to allow that.

First, how do you hide the Database window in VBA?

Second, in VBA how do you keep F11 from poping-up the
window in my MDE?

Thanks.... Frank
 
F

Frank B

Thanks Tim, but I seem to be missing something,

If in the MDB I tell start up to hide the database and
disallow Special keys, then create the MDE. The MDE works
the way I want it. That's great.

But, if I forget to uncheck Allow Special keys before
closing the MDB, and close it, then when you restart the
MDB (with Database not visible, and having disallowed
Special Keys) HOW do you recover in the MDB? F11 will not
work.

What am I missing here??? Thanks again.... Frank
 
F

Frank B

I tried this in a test.mdb.. No Database visible, and
Special keys disallowed in both the MDE and MDB when
closed. But this is not enough....

In the menu bar, you can select Window/Unhide (in both the
MDE and MDB) to bring back the Database window. That is
not what I want for the MDE. So, this now sounds like I
have to toggle off the standard menu bar, and display my
own menu bar in the MDE.

I still would like to know how to make the database not
visible, and disable Special Keys in VBA.

Thanks for your ideas.... Frank
 
A

Allen Browne

Frank, you might also want to set the MDE's AllowBypassKey property, so a
user can't just hold down the Shift key to bypass your startup code.

Did you realise you can set the properties in the MDE after it has been
created? Create a small utility database for yourself, paste the code below
into a standard module, type in the correct name for your MDE file, and then
in the Immediate window:
? StartupProps(False)

Function StartupProps(bSet As Boolean)
Dim db As DAO.Database
Dim strDb As String
Dim strPrp As String

strDb = "C:\My Documents\MyFrontEnd.mde"
Set db = OpenDatabase(strDb)

ChangeProperty db, "StartupShowDBWindow", dbBoolean, False
Call ChangeProperty(db, "AllowSpecialKeys", dbBoolean, bSet)
Call ChangeProperty(db, "AllowBypassKey", dbBoolean, bSet)

db.Close
Set db = Nothing
End Function

Function ChangeProperty(dbs As Database, _
strPropName As String, varPropType As Variant, _
varPropValue As Variant) As Integer
Dim prp As Property
Const conPropNotFoundError = 3270

On Error GoTo Change_Err
dbs.Properties(strPropName) = varPropValue
ChangeProperty = True
Debug.Print strPropName & " is " & varPropValue

Change_Bye:
Exit Function

Change_Err:
If Err = conPropNotFoundError Then ' Property not found.
Set prp = dbs.CreateProperty(strPropName, _
varPropType, varPropValue)
dbs.Properties.Append prp
Resume Next
Else
' Unknown error.
ChangeProperty = False
Resume Change_Bye
End If
End Function
 
T

Trois Jay

Maybe this might be of help. Be sure to read the instructions twice, otherwise you end up with a database of which you have locked
yourself out....

====================================================
The Access Property Editor utility allows you to edit the
startup properties for an MDB file without having to open
the database directly. The utility is primarily intended
for Access developers who prefer to distribute their mdb
or mde applications with the AllowBypassKey property
disabled.

Jamie's Software
http://www.jamiessoftware.tk
====================================================


Regards,

Jacques J.J. Soudan

3J Consultancy
www.troisj.com






Before creating an MDE, I can set Startup to hide the
Database window. Then create the MDE. But, when the MDE
is running you can press F11 and it pops-up. I don't want
to allow that.

First, how do you hide the Database window in VBA?

Second, in VBA how do you keep F11 from poping-up the
window in my MDE?

Thanks.... Frank
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top