Turning on what is turned off in Startup

Turning on what is turned off in Startup

Post by Joe Cilinc » Fri, 26 Nov 2004 22:32:54


I have DoCmd.SelectObject acForm, , True for turning back on the Display
Database Window which is turned off in the Startup. What would it be for
Allow Full Menus and Allow Built in Toolbars.


--
Thanks

Joe Cilinceon
 
 
 

Turning on what is turned off in Startup

Post by Allen Brow » Fri, 26 Nov 2004 23:04:10

If you are completely locked out, you can use another database to set these
properties. Just set the strDb to the fully qualified path name for your
applicaiton, and remove the quotes from the beginning of the lines you want
to change:


Option Compare Database
Option Explicit

Function StartupProps(bSet As Boolean)
Dim db As DAO.Database
Dim strDB As String
Dim strPrp As String
strDb = "C:\MyPath\MyFile.mdb"
Set db = OpenDatabase(strDB)

' Application.SetOption "Track Name AutoCorrect Info", bSet
' Application.SetOption "Perform Name AutoCorrect", bSet
' Application.SetOption "Log Name AutoCorrect Changes", bSet

' ChangeProperty db, "StartupForm", dbText, "Form1"
' ChangeProperty db, "StartupShowDBWindow", dbBoolean, bSet
' ChangeProperty db, "StartupShowStatusBar", dbBoolean, bSet
' ChangeProperty db, "AllowBuiltinToolbars", dbBoolean, bSet
' ChangeProperty db, "AllowBreakIntoCode", dbBoolean, bSet
' Call ChangeProperty(db, "AllowFullMenus", dbBoolean, bSet)
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

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://www.yqcomputer.com/
Reply to group, rather than allenbrowne at mvps dot org.

 
 
 

Turning on what is turned off in Startup

Post by Joe Cilinc » Fri, 26 Nov 2004 23:11:08

Nope not locked out since I can hold down the Shift key when I open it. No I
just want the database to open not showing it. I have an Option button to
view the database files and there I would like to turn every thing back on.
I'll study what you gave me here Allen and thanks alot. g

--

Joe Cilinceon




these
want


Display
 
 
 

Turning on what is turned off in Startup

Post by Allen Brow » Fri, 26 Nov 2004 23:19:57

o if you can get into your database, you can use the same code on
CurrentDb().

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Joe Cilinceon" < XXXX@XXXXX.COM > wrote in message
news: XXXX@XXXXX.COM ...


 
 
 

Turning on what is turned off in Startup

Post by Joe Cilinc » Fri, 26 Nov 2004 23:28:56

hanks Allen, greatly appreciated.

--

Joe Cilinceon


"Allen Browne" < XXXX@XXXXX.COM > wrote in message
news: XXXX@XXXXX.COM ...
No
to
your