Solved How can I Hide Access And only view Forms (1 Viewer)

Thank you very much. Restore command worked. Now app opens on it orginal 1st form size. :)
Congratulations! Glad to hear you got it sorted out. Good luck with your project.
 
  • Love
Reactions: Ihk
@isladogs Very nice effort. As said above, I was looking for hiding access app interface and came across.
I downloaded your app version 3.55 (SetWindows - v3.55). Tried to implement, it gives code compilation error, code incompatible with version.
I have ms access 2021 profession version 64bit.
And end users who will have accde file, will have different versions 2016 mostly but some with 32bit, and some 64bit. I always create two versions of accde 32bit and 64bit and send both to all users.
How to solve this "Setwinows" to hide app interface.

The old links to my example app no longer work correctly. I've just updated the link in post #10.

Having said that I don't know why you got an error with v3.55 wherever you downloaded it from.
I have re-tested that version successfully in both Access 2010 & 365 (32-bit & 64-bit in each case).
I don't have A2021 but its almost identical to 365

However, the latest version of my app is v3.61 and can be obtained here:

I would be grateful if you could try that version and let me know if you find any issues.
If so, please email or PM me giving me further details so I can troubleshoot if necessary. Thanks in advance

You will always have to compile any ACCDB file converted to ACCDE in the correct bitness required by users whether or not it uses APIs.
I distribute my commercial apps using a professional installer program and, like you, include both bitnesses of ACCDE within the EXE file created.
The installation script checks the Office bitness and only installs the appropriate ACCDE version
 
  • Like
Reactions: Ihk
Congratulations! Glad to hear you got it sorted out. Good luck with your project.
Just to help others, I want to sum up ... as above mentioned.
code on Form Load
Code:
DoCmd.ShowToolbar "Ribbon", acToolbarNo
and to restore the size
code on form close
Code:
DoCmd.RunCommand acCmdAppRestore

Note: this way application window will be hidden, you will have top bar with close, min, max buttons. Your app will be strechable to increase or decrease size. For this I am thankful to @theDBguy
 
Last edited:
The old links to my example app no longer work correctly. I've just updated the link in post #10.

Having said that I don't know why you got an error with v3.55 wherever you downloaded it from.
I have re-tested that version successfully in both Access 2010 & 365 (32-bit & 64-bit in each case).
I don't have A2021 but its almost identical to 365

However, the latest version of my app is v3.61 and can be obtained here:

I would be grateful if you could try that version and let me know if you find any issues.
If so, please email or PM me giving me further details so I can troubleshoot if necessary. Thanks in advance

You will always have to compile any ACCDB file converted to ACCDE in the correct bitness required by users whether or not it uses APIs.
I distribute my commercial apps using a professional installer program and, like you, include both bitnesses of ACCDE within the EXE file created.
The installation script checks the Office bitness and only installs the appropriate ACCDE version
Thank you very much for getting me back. I tried this new version v3.61 from your website. Your app itself is very nice, so many functionalities, really a lot of input to help others. I am grateful.
Important to mention: credit > Control Application Interface (isladogs.co.uk)
I tried to implement in my app. It worked now, but with a problem which was mentioned on your website. If we click on task bar the app window (shell) appears in background.
1) I used module named as "modDatabaseWindow"
2) on form Load, as per your website

Code:
Private Sub Form_Load()

On Error GoTo Err_Handler

   SetAccessWindow (SW_SHOWMINIMIZED)

   DoCmd.Restore

Exit_Handler:
   Exit Sub

Err_Handler:
   MsgBox "Error " & Err.Number & " in Form_Load procedure : " & Err.description
   Resume Exit_Handler

End Sub

But to prevent to re-appearance of app window by click on taskbar, you provided the function
Code:
Function HideAppWindow(frm As Access.Form)

   'new code - app window is NOT restored when taskbar icon clicked
   'omit the ...Or WS_EX_APPWINDOW ...section if you want to hide the taskbar icon
   SetWindowLong frm.hWnd, GWL_EXSTYLE, GetWindowLong(frm.hWnd, GWL_EXSTYLE) Or WS_EX_APPWINDOW
   ShowWindow Application.hWndAccessApp, SW_HIDE
   ShowWindow frm.hWnd, SW_SHOW

End Function

I treid to call this on form load, at the beginning of above code (at form load) as
Code:
call HideAppWindow
It does not work. I am not sure what mistake am doing.
 
Last edited:
The 'problem' you mention was solved a long time ago with the updated code

Did you check the code in my example app?

The function is Function HideAppWindow(frm As Access.Form)
You call it in a form as: HideAppWindow Me where Me references the current form.
It isn't necessary to use Call

If you omit Me you will indeed get an error as the code won't know which form is being referenced
 
  • Love
Reactions: Ihk
The 'problem' you mention was solved a long time ago with the updated code

Did you check the code in my example app?

The function is Function HideAppWindow(frm As Access.Form)
You call it in a form as: HideAppWindow Me where Me references the current form.
It isn't necessary to use Call

If you omit Me you will indeed get an error as the code won't know which form is being referenced
Thank you. it worked by using "Me"
what I have
1st form = Login
2nd form = Dashboard
On successful login, normally this form goes on hide, and main dashboard opens (fit to screen).
Now my login form (1st form) wont hide, it stays on top of dashboard. I will try to tacle this later, (main idea worked) thank you.
Another question, referring to above mentioned.
I distribute my commercial apps using a professional installer program
which installer do you use?
 
I use SamLogic VisualInstaller Professional which includes the scripting feature needed for this purpose.
The cheaper Standard version lacks the scripting feature.

Other installers are available with a variety of features and prices from free to very expensive
 
  • Love
Reactions: Ihk
Now my login form (1st form) wont hide, it stays on top of dashboard. I will try to tacle this later, (main idea worked) thank you.
Please tell me how you solve the problem if possible, i need to hide a form, not close it, but i cant do that after "HideAppWindow Me"
 
Please tell me how you solve the problem if possible, i need to hide a form, not close it, but i cant do that after "HideAppWindow Me"
Hi. Welcome to AWF!

To hide a form, have you tried using Me.Visible = False?
 
If you are hiding the application interface using my HideAppWindow Me code, then all you have on the screen is the popup form floating on the desktop.
If you then try to hide the form using Me.Visible=False, what do you want to happen/expect to happen?
 
If you are hiding the application interface using my HideAppWindow Me code, then all you have on the screen is the popup form floating on the desktop.
If you then try to hide the form using Me.Visible=False, what do you want to happen/expect to happen?
I want to hide the form1 when the form2 popup, and show the form1 when the form2 close. I thought about to close the form instead of hide, but so many forms can popup form2, and openargs are used to pass a value already, I cant confirm reopen which form.
 
Hi. Welcome to AWF!

To hide a form, have you tried using Me.Visible = False?
I want to hide the form or just keep the popup form stay on top, but if I use "HideAppWindow Me", the "visiable" and "modal" options are all invalid.
 
You need to only have one form open at a time when the application window is hidden.
If you study my example app containing that code, you will see I am scrupulous about closing each form when another form is opened
 
You need to only have one form open at a time when the application window is hidden.
If you study my example app containing that code, you will see I am scrupulous about closing each form when another form is opened
Yes, I think one form open at a time is a good idea, but the form2 could be open by form1 form3 form4 etc... I can't find which form should be reopen after form2 were closed, so I use visible option.
 
You could set a global variable or TempVar to the value of the form being closed. Then use that to reopen that form when the next one is closed.
That should work

Otherwise, If the logic is too complicated for you to deal with in your app, I suggest you don't hide the application window
 
You could set a global variable or TempVar to the value of the form being closed. Then use that to reopen that form when the next one is closed.
That should work

Otherwise, If the logic is too complicated for you to deal with in your app, I suggest you don't hide the application window
Good idea! I will try it, thanks for your reply
 
Could even pass calling name to called name form via OpenArgs?
 

Users who are viewing this thread

Back
Top Bottom