Bob: Actually I resolved this last night. With the Macro that I'm using to run the code, I just added another line to it with the command "Quit". Everything seems to be working great now!
Thank you again for your speedy response and help with this.
JB
I have some code here that works fine as far as opening up a second database. The problem I seem to be running into now is when I close the original Db, the new database I just opened closes too.
Any ideas out there on how I might add some code to this? My goal is to have this code in a form...
Code that I have the works for this close is:
*****Code Start*****
Dim ObjAccess As Access.Application
Set ObjAccess = GetObject(""File Path Name")
ObjAccess.CloseCurrentDatabase
ObjAccess.Quit
*****Code End*****
My problem is that if I accidently hit this button when the other database...
I want to be able to close one access database by using another. I did have some code that involved the "GetObject("FilePathName") command, and it worked but of course I didn't save it and I managed to lose it :(
What I'm looking for is a code that when I have it attached to a button on a form...
I took out the line to run the macro to see if I can get just the file to open first. I just put the code in a .vbs file and it did the exact same thing when I ran it (Open and closed immediately). Let me know if you have any luck with this. Thanks.
JB
Would it still work the same if I put this in a module in another Access file? I got it where the window opens but then closes immediately after. Here is the code I have, any help why you think it might not be working would be greatly appreciated.
**********Code Start**********
Option Compare...
Where would you normally insert this code? On a form with a button, marco...? I can't seem to get the window to stay visible, it still closes imediately, do I need to change my reference?
JB
I like the sounds of the first part talking about opening up the secured database in another runtime instance. I'm just still hazy on how to go about it. Am I just creating a VB file, and then on click it runs or what? I didn't understand this part from alancossey:
VB6 code to open Access OK...
I'm pretty sure that the Users are savy enough to look at the back end by linking or importing, and also viewing system objects. I'm pretty confident they wouldn't know where to look as far as passwords are concerned though.
A password would protect the objects from being linked to. That is the purpose I am trying to get here. It looks like I'm just at a dead end and Access is really limited as far as security is concerned.
I would have to enter this code in for every query? Couldn't this still be viewed if I just checked the view "Hidden" objects from a blank database when trying to link to this one I'm trying to hide the queries in?
JB
Is there a way of Password protecting an Access 2007 database automatically through VBA? This is going to sound funny but I am pretty sure if this will work then I might have it fairly secure.
I'm looking for code that will diable the password on open and set the password on close. Is this...