You should just be able to paste that code into a form/module in your Access project, then add the line of code below wherever you want to hide Access (this must be after at least one form is visible):
Ok so I pasted it all into a module, then created a command button on my form to test it. Opened the form hit the cmd button and it says, Cannot hide Access with tblPSR on screen. Which tblPSR is the name of my form and it's on the screen. So what's up??
Well that message is shown if the following If is true:
VB Code:
ElseIf nCmdShow = SW_HIDE And loForm.PopUp <> True Then
For the first half, nCmdShow must equal SW_HIDE, as that is the operation that you are trying to perform.
For the second half (the part that you can effectively change) the PopUp property of loForm (the active form) needs to be True in order for the If to fail, and thus hide the window. So, go into the property page of the form and change Popup to True (or possibly Yes).
Ok, it seems that this code isn't quite what you want then.. and I'm not even sure that it would be possible, as the form you have created is a 'child' of the main Access window.
You can also fool your user's into thinking it is something other than access..
In the Tools, Startup option screen do the following
Set an Application Icon for the database and an Application Title, untick the following:
Allow Full Menus
Allow Built In Toolbars
Display Database Window
Display Status Bar
Allow Toolbar/Menu Changes
Allow Default Shortcut Menus
On top of this it is best to create your own customised menu bar with the options you want available and any toolbars that you want, you may also want to remove some of the built in options behind the forms, like record selectors, navigation buttons and dividing lines. Plus if you are allowing shortcut menu's on your forms then design one that you want and set this to each form's Shortcut Menu Bar.
Then set a start-up form and your users will not see any reference to Access itself.
You can even disable the Bypass Key (Shift) but you must be careful with that one.
Last edited by dannymking; Oct 9th, 2005 at 05:38 AM.
Danny
Never Think Impossible
If you find my answer helpful then please add to my reputation
Here is what my screen looks like. I was under the impression that if you create the form as a pop-up then the code above will hide the Main access window with your current form still up???