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

faq 702-5449: Tried it, now something gone horribly wrong!

Status
Not open for further replies.

SMHSleepy

Technical User
Sep 8, 2009
174
CA
Hello, I tried the following suggestion to hide Access and have it run only my forms. Now I can't get in to do any editing! It tells me the database is locked. I'm in desparate need of repair here. Thanks.

____________________________________________


How Can I completely hide Access so only my forms are visible
faq702-5449
Posted: 29 Sep 04


Create a New Database

Create a Form and change its pop up property to True
Create another form called frm_main, this is the form that you want to use.

Add the following code to the first form


CODEPrivate Declare Function ShowWindow Lib "user32" _ (ByVal hwnd As Long, ByVal nCmdShow As Long) As LongPrivate Sub Form_Open(Cancel As Integer) Call ShowWindow(hWndAccessApp, SW_HIDE) DoCmd.OpenForm "frm_main", windowmode:=acDialog End SubPrivate Sub Form_Unload(Cancel As Integer)Dim lngret As Long lngret = ShowWindow(hWndAccessApp, SW_MAXIMIZE)End Sub
Change the start up properties of the database, to start up with your first form and Voila,

Access without urm Access.

Notes.
1. You Cant run reports
2. You need to put a application.close line in on your exit button otherwise Access will still be open if you just use the close form button.

 
If you do not have any backup, you have to create a new database and import all objects from the locked database into a new one.

You may also create a new database and create a simple procedure to access the locked database (using Access object model) and change the StartUp property. But that takes more time.

Seaport
 
Thank you seaport, I certainly do have a backup so no data loss. The only loss is some new forms I created but I should just consider myself lucky! Thanks again.
 

I haven't tried this particular hack for this task, but tried several similar ones a couple of years ago and finally gave up, for this very reason. The problem was that they sometimes/b] left the ldb] file in existence after closing. The only way to get rid of it was to reboot the PC, after which the database could be run as usual.

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top