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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set Startup form, now I've really messed it up! 4

Status
Not open for further replies.

JimHutton

Programmer
Sep 26, 2003
25
0
0
GB
Ho there.

I decided to have a fiddle with the database and see if I could hide things from view, so I went to the start-up options, ticked all the boxes, then pressed ok,

Worked great hid everything, but how do I get it back?

Gutted and Frustrated,
Jim
 
Hi,

To get back into the startup options, do the following:

1. open database in access
2. Press Ctrl G to open the debug window.
3. Type the following in there:

DoCmd.RunCommand acCmdStartupProperties <RETURN>

This will open the startup properties screen so you can change anything back.

John
 
Hi,

Perhaps I should have been more specific:

1. Open database
2. If datdatabase window doesn't appear, press F10 to open it.
3. Hold down ctrl key and press g (which should open the debug window)

If it still doesn't work, then get back to me.

John
 
Hi,
When everything fails, create a new blank database and import all your objects from the old database.

You will have a new database with full options.

Regards
Zameer
 
It sounds like you trying to hide your entire database from users? and only let them see a form to input data.
I have created a database that has a front end form and that is all they see. Only the form. All other information about the database is unavailable to them. I as the author can turn this feature on, and when I need to work in the database, turn this feature off so I can see all information in the database.

If this sound like what you need, let me know and I will post the code.
Kirk
 
Hi,

Nope still don't work

Zameer thanks, I can see again!

Kirk, if you could supply some code I'd me most grateful

Kindest Regards
Jim
-
 
Hey Jim,
I created a main menu form that opens automatically when the database is opened. On this form are, among other buttons, 2 ones called run time and developer. Run time removes from view the database and everything else except the main menu. Developer button puts all information back for all to see. Both buttons should point to the following module code.

Option Compare Database
Option Explicit

Private Sub B_debug_Click()
ChangeProperty &quot;StartupShowDBWindow&quot;, dbBoolean, True
ChangeProperty &quot;StartupShowStatusBar&quot;, dbBoolean, True
ChangeProperty &quot;AllowBuiltinToolbars&quot;, dbBoolean, True
ChangeProperty &quot;AllowFullMenus&quot;, dbBoolean, True
ChangeProperty &quot;AllowBreakIntoCode&quot;, dbBoolean, True
ChangeProperty &quot;AllowSpecialKeys&quot;, dbBoolean, True
ChangeProperty &quot;AllowBypassKey&quot;, dbBoolean, True
MsgBox &quot;Application Properties changed. Reopen database to see affect.&quot;
End Sub

Private Sub b_RunTime_Click()
ChangeProperty &quot;StartupShowDBWindow&quot;, dbBoolean, False
ChangeProperty &quot;StartupShowStatusBar&quot;, dbBoolean, False
ChangeProperty &quot;AllowBuiltinToolbars&quot;, dbBoolean, False
ChangeProperty &quot;AllowFullMenus&quot;, dbBoolean, False
ChangeProperty &quot;AllowBreakIntoCode&quot;, dbBoolean, False
ChangeProperty &quot;AllowSpecialKeys&quot;, dbBoolean, False
ChangeProperty &quot;AllowBypassKey&quot;, dbBoolean, False
MsgBox &quot;Application Properties changed. Reopen database to see affect.&quot;
End Sub

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

Set dbs = CurrentDb
On Error GoTo Change_Err
dbs.Properties(strPropName) = varPropValue
ChangeProperty = True

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


PS always make a backup of the database before any changes are made incase of an unrecoverable error. I learned the hard way.
Let me know how you make out.
Kirk
 
Press and hold the Shift key while opening the database. The shift key will bypass the startup options and they will not run.

SAThandle



definition of 'less behind': &quot;not fully caught up, digging out slowly, one-week delay to &quot;The IT hit the fan.&quot;
 
I'll give that code ago... Thank you.

Gosh, the Shift Key? - Wow it worked!

Thank you all for the help!


Kindest Regards
Jim
-
 
If you need to set the database so savy users cannot do this, you will need to set the startup property &quot;AllowShiftKeyBypass&quot; using the ChangeProperty code listed by Kirk. I believe before changing the property, though you must create it. Do a keyword search on AllowShiftKeyBypass. I caution you, however, make sure that you have a way of changing your AllowShiftKeyBypass back to True.

SATHandle


definition of 'less behind': &quot;not fully caught up, digging out slowly, one-week delay to &quot;The IT hit the fan.&quot;
 
Hi Sathandle,

Just to clarify, my code has nothing to do with setting up the &quot;AllowShiftKeyBypass&quot; propertys. These are 2 different and equally good ways to do hide the database from users.

Kirk
 
Thanks, JRBarnett. That DoCmd.RunCommand in your first response just stopped a major panic attack. I turned off the menus to the point where I couldn't get them back, and for some reason, the Shift key on startup wasn't letting me see them either.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top