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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How To Hide Access Window Fram? 5

Status
Not open for further replies.

yousef20

Programmer
Jul 24, 2004
9
SA
Good morning

Can any help with a code to hide Access Window frame

I mean that when I start my DB it will display the 1st form as if it where an .exe file without the access toolbars and without Access window frame

 
I'm wondering that myself. So the form appears as a popup, with nothing in the background, maybe just your desktop, for example.
Whenever I may download an "application"(calender, verb conjugator, world clock), from the web, I get this "format".
very cool & handy.
 
From what I understand, you have to define your own tool bars, etc. It looked like a lot of work, so I just moved on since it is not a requirement within my environment.
 
Yousef,

First, paste this code in the module section:

Option Compare Database
Option Explicit

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

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

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
''''''''''''
' End Code '
''''''''''''


Second, make all forms "Yes" on the popup property that you want to hide access window.

Third, create a macro:

Call it "mcrHide"
Action: Run Code
Function Name: fAccessWindow("Minimize",False,False)

Call this macro on the first form that opens on your database ( e.g. Switchboard):

On Open Event:
DoCmd.RunMacro "mcrHide"


Now, when your first form(e.g Switchboard) opens the access window will be hidden.









 
ssatech, Thank you very much you help me alot
 
I have been looking for something like this. I tried it and it works great! Thanks for the post!

Can you tell me how to turn my final Access database into and .exe file or something that will install to a specific location?
 
Agates2,

If you and your users have winzip 8 you can create a self extracting executable, in which you can specify where to extract it to.

This can then be emailed or stored in a central location with a shortcut emailed to your users.

Mike
 
agates2, this is a good question

Mikeauz, this is also a good choice but if there were an alternative to use Visual Basic this will minmize any risk of not having WINZIP

my Question here is there a way to do that using either Visual Basic or VBA to that?
 
If anyone would prefer an option without a macro, but all vb, look at mgolla's response to my thread702-798009 . I am using it, and it is awesome!

Stephen [infinity]
"Jesus saith unto him, I am the way, the truth, and the life:
no man cometh unto the Father, but by me." John 14:6 KJV
 
Then kjv1611, could you please assist me in the following. Please highlight the differences between the three functions (mstrmage1768 (the faq I linked to), ssatech and mgolla), because I fail to see any difference at all - to my grumpy old eyes, they are identical. Only difference I can see, is mgolla invoking the function from VBA, whilst the other uses macros. You are saying you are familiar with mgollas code, didn't you see any similarities?

Due to agreed upon naming conventions, relative likeness in coding style etc, I'd expect similarities between different approaches to the same task, using the same API's etc, but look at the name of the function, variable names, order of the tests, empty lines at the same places, linebreak in the second api declaration, but not in the first nor in the function declaration...

Between mstrmage1768's faq and ssatech reply in this thread, even the number of single quotes in the End Code comment is equal, as is the suggested name of macro to invoke the function.

I don't think this is coincidental, I think someone has done a copy/paste without acknowledging other's work. I do not know who, neither do I want to suggest who, but I strongly urge those who post code as if it was their own, to acknowledge the work of others. When no acknowledgment is present, to me that means the poster claims that they've produced the code themselves. My personal distaste for such, is of course the reason for my reply, but I have a rather strong feeling it is not exactly encouraged neither by those who've done the original work, nor the Tek-Tips management.

Roy-Vidar
 
Hmm, didn't look really close at it before I referenced it. Just kind of skimmed it, so the naming/style conventions, as you mentioned, very well could be the only difference. I guess I just assumed it was different just from skimming over quickly, and posted the link. Anyway, I'd agree to give credit where credit is due. That's what I attempt to always do, myself. [SMILE]

Stephen [infinity]
"Jesus saith unto him, I am the way, the truth, and the life:
no man cometh unto the Father, but by me." John 14:6 KJV
 
Here is an update for ssatech code snippet.

Because Access is hidden a MsgBox will NOT be visible...
They will open, but remain hidden and never receive focus...
You can start to imagine the # of msgbox that may open!

All error handling must be passed to a module or another form using the OpenArg method, with this forms properties set to Popup.

AccessGuruCarl
Programmers helping programmers
you can't find a better site.

I hope this helps...
 
Hmm.. interesting, though I don't think I've experienced that problem with the code I've been using as of yet. I'll try to give it a try, and see what happens.

Stephen [infinity]
"Jesus saith unto him, I am the way, the truth, and the life:
no man cometh unto the Father, but by me." John 14:6 KJV
 
Hello Gang,

I have always been leary of this, but incorporated it into an application that uses one form as frame and all other forms are loaded as a subform to the frame so this works out great!!!

However I am not able to see my reports. What am I not doing?

ProDev, MS Access Applications
Visit me at ==>
May God bless you beyond your imagination!!!
 
I don't use any of this, so I don't know, but of the three identical code snippets posted/referenced here, the faq by mstrmage1768 contains most information, also something relating to previewing reports (se #5 in the faq I linked to)

Roy-Vidar
 
This works fine for me, but when I added access security using the wizard it stops working.

Does anyone know how to have it work with security?

Thanks
Chris
 
Okay, I tried the trick listed by BigBadBen, but got the error again shortly after. Here is currently everything listed in that file (after taking out the part mentioned above):

[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /fastdetect


Also, a note, it was on the same line with the /fastdetect part, and I just removed what looked like the section for that statement - on one machine (the one w/errors), it was originally listed after the fastdetect part, but on the other, it was listed before the /fastdetect.

Any other advice/help would be greatly appreciated. If still occuring, would someone guess it actually is the board after all?

Stephen [infinity]
"Jesus saith unto him, I am the way, the truth, and the life:
no man cometh unto the Father, but by me." John 14:6 KJV
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top