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

General MS Access Question

Status
Not open for further replies.
Feb 29, 2004
75
US
I have a databse on MS Access. My database organization is a mess because i have like tens of forms open as a reuslt of the navigation. Is there any way that theres just one form at one time. As you click the link another form opens over the current. Its just like have a webpage and an application. Goal: Not to have a dozen forms open while running the database.


also /Is there to have a executable or something like that to open the database
 
When you open a new form, close the one you're leaving (docmd.close)...is that what you're looking for?
 
Yes That what I am looking for..

Its an office db so i dont want users to be opening the database is there any way of having restrcited access or like an executable..thanks alot
 
I'm confused as to what you're asking. You don't want your users to get into the db? You can lock them out of most things on the Tools->Startup menu (uncheck the "Show Database" and "Allow special keys")...but they can still get in using the shift key. That can be disabled as well...through some code...but then you can't get in without some kind of database with more code.

Another option is to have a startup form that opens up when the db opens...and if the user doesn't pass certain criteria (i.e. not your computer name) then close the database.
 
Maybe I can get into security abit later.
How do I make sure I dont have tens of forms open while a user is using the database. U said something about docmd.close.. i am guess that would close the form if I click a button leading to another form or the switchboard. Where would i put this command in the VB code
thanks in advance
 
You have a button that opens the new form...under that button is some code that probably looks something like this:

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "YourFormName"
DoCmd.OpenForm stDocName, , , stLinkCriteria

To close the current form as you move to the new one you'd just need to add this after the openform statement above:

DoCmd.Close

Just be careful...you need to make sure that there's always a form open...meaning when you close this new form, make sure you open another one.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top