Re: Hide main Access window
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):
Call fSetAccessWindow(SW_HIDE)
Re: Hide main Access window
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??
Re: Hide main Access window
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).
Re: Hide main Access window
Great! But when I hit the cmd button it hides all of Access and the form too.
Re: Hide main Access window
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.
I've tried to find previous examples on this site where this sort of thing has been done, these were the closest I could find:
http://www.vbforums.com/showthread.php?t=353923
http://www.vbforums.com/showthread.php?t=355443
http://www.vbforums.com/showthread.php?t=346258
http://www.vbforums.com/showthread.php?t=113426
Re: Hide 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.
1 Attachment(s)
Re: Hide main Access window
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???
Re: Hide main Access window
Write an interface using VB and access the database that way