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!

hide database window only show form Access 2010

Status
Not open for further replies.

1DMF

Programmer
Jan 18, 2005
8,795
GB
Hi,

I seem unable to make the main DB window go away?

I don't have show navigation pane, what else do I need to do so when the app opens it is only the size of the form and not the entire window with the DB grey background?

Thanks,

1DMF

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"

MIME::Lite TLS Email Encryption - Perl v0.02 beta
 
I found this...
Code:
Option Compare Database
Option Explicit
Global Const SW_HIDE = 0
Global Const SW_SHOWNORMAL = 1
Global Const SW_SHOWMINIMIZED = 2
Global Const SW_SHOWMAXIMIZED = 3
Private Declare Function apiShowWindow Lib "user32" _
                                       Alias "ShowWindow" (ByVal hWnd As Long, _
                                                           ByVal nCmdShow As Long) As Long
                                                           
Function fSetAccessWindow(nCmdShow As Long)
   Dim loX As Long
   Dim loform As Form
   On Error Resume Next
   Set loform = Screen.ActiveForm
   If Err <> 0 Then
      loX = apiShowWindow(hWndAccessApp, nCmdShow)
      Err.Clear
   End If
   If nCmdShow = SW_SHOWMINIMIZED And loform.Modal = True Then
      MsgBox "Cannot minimize Access with " _
             & (loform.Caption + " ") _
             & "form on screen"
   ElseIf nCmdShow = SW_HIDE And loform.PopUp <> True Then
      MsgBox "Cannot hide Access with " _
             & (loform.Caption + " ") _
             & "form on screen"
   Else
      loX = apiShowWindow(hWndAccessApp, nCmdShow)
   End If
   fSetAccessWindow = (loX <> 0)
End Function
but if you use it none of your forms are then visible?

The entire app the forms everything vanishes and all you can do is kill the AccEss process?

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"

MIME::Lite TLS Email Encryption - Perl v0.02 beta
 
doesn't seem to matter if your forms are pop / modal or both, if you use SW_HIDE, you loose everything and I don't know how to get access back other than kill the process.

anyone?

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"

MIME::Lite TLS Email Encryption - Perl v0.02 beta
 
Not correct.

I use the following code:

Const SW_HIDE = 0
Const SW_SHOWNORMAL = 1
Const SW_SHOWMINIMIZED = 2
Const SW_SHOWMAXIMIZED = 3

Private Declare Function IsWindowVisible Lib "user32" (ByVal hwnd As Long) As Long
Dim dwReturn As Long

Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, _
ByVal nCmdShow As Long) As Long

Public Function fAccessWindow(Optional Procedure As String, Optional SwitchStatus As Boolean, Optional StatusCheck As Boolean) As Boolean
If Procedure = "Hide" Then
dwReturn = ShowWindow(Application.hWndAccessApp, SW_HIDE)
End If
If Procedure = "Show" Then
dwReturn = ShowWindow(Application.hWndAccessApp, SW_SHOWMAXIMIZED)
End If
If Procedure = "Minimize" Then
dwReturn = ShowWindow(Application.hWndAccessApp, SW_SHOWMINIMIZED)
End If
If SwitchStatus = True Then
If IsWindowVisible(hWndAccessApp) = 1 Then
dwReturn = ShowWindow(Application.hWndAccessApp, SW_HIDE)
Else
dwReturn = ShowWindow(Application.hWndAccessApp, SW_SHOWMAXIMIZED)
End If
End If
If StatusCheck = True Then
If IsWindowVisible(hWndAccessApp) = 0 Then
fAccessWindow = False
End If
If IsWindowVisible(hWndAccessApp) = 1 Then
fAccessWindow = True
End If
End If
End Function

The form must be Pop Up and Modal. Call the above function in the form load. ie.,
' hide the Access window
fAccessWindow "hide", False, False

Ensure the form has a close button to close the application.

I have used the above code in many applications (AC2003 and AC2007) for years - no problems.

Tom
 
Nope , no good.

It hid the DB shell but after completing the form, no other forms were visible in the application. I had to kill the app.

Now everythime i run the app not even the first form is visible, there is no form , no app shell, nothing, just a process that has to be killed.


"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"

MIME::Lite TLS Email Encryption - Perl v0.02 beta
 
OK found the problem.

Every single form in the application HAS to be 'popup' & 'modal', this isn't a solution!

MS expects me to edit my enitre application and set every single form in it to be Modal, when the users don't want that? Some forms are not modal because of the user experience required while using the application.

So basically the answer is - it cannot be done!

Of all the threads I've searched, the hours I've wasted and the methods I've tried, not one person said
It is not possible to have a normal access application and hide the access shell, like it used to be possible to do with one small tick in access 2003.


Is everyone high in the Access development team @ Microsoft or something?



"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"

MIME::Lite TLS Email Encryption - Perl v0.02 beta
 
For those neededing the definitive 'working' answer I have written an FAQ : faq181-7522

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"

MIME::Lite TLS Email Encryption - Perl v0.02 beta
 
I am using Access 2007, and the code provided by StarPassing works for me in hiding Access... and NONE of my forms are modal!

I put this into the form I'm using as a switchboard:

Private Sub Form_Load()
' hide the Access window
fAccessWindow "Minimize", False, False
End Sub

Using "Minimize" instead of "Hide" still makes anything that isn't a pop-up go away. However, I had to go through my reports and change them so they would not auto-resize.
I do use one table which I did not want to be a pop-up. For that, I included the line following line whenever I navigated to the table from my main menu:

fAccessWindow "Show", False, False

The nice part of having that table is I could go back to the Access shell anytime I needed to.
 
So to be clear you want to hide the Access Application Window and show only forms...

I took your subject to mean you wanted to keep people from seeing the navigation pane, to basically lock down your application.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top