Hiding Database Window

sizzle

New member
Local time
Today, 00:00
Joined
Nov 18, 2003
Messages
6
hiding access window-help!

I have read all the posts on this forum and other websites but I still can't get this to work. I am VERY new to access. I have only been using it a couple of weeks.

I am not sure what to do with the code that is available. I have tried everything. I keep getting compile errors. Ambiguous name detected: SW_HIDE.

I am just trying to make a small application that actually looks like it is a program.

Thanks,
Linda
 
Not sure of the code you are using but...

This will hide the "Window"
DoCmd.RunCommand acCmdWindowHide

Does the same thing as clicking "Window / Hide" from the menu bar.

This will bring it back.
DoCmd.RunCommand acCmdWindowUnhide
 
The link below is what I am trying to do. I used the code that was supplied with this thread and still can't get it to work. I am not sure what code to put where. :confused:

link to thread

Thanks,
Linda
 
sizzle -

See my post in this thread here:
http://www.access-programmers.co.uk...s=&threadid=4553&highlight=hide+access+window

Download the attachment in my post. Once you have the attachment downloaded - unzip the files. Next open your database and from the file menu select: File--Get external Data -- Import form the menu. Navigate to the file you just imported and select the module from the options. Then all you have to do is put this code:
fSetAccessWindow (SW_HIDE)

In the 'On_Load' event of your startup form. You should be all set now but make sure you set your forms to modal=Yes and popup=yes so that the forms will be displayed. Alos - read my warning in the post about some of the potential pitfalls of using this method to hide access...

EDIT* - having jus read your last post as I was typing at the time the link you posted is the same that I just posted :) Follow my instructions and you'll be all set...

HTH,
Kev
 
Hi Kev,

I tried it and it wouldn't import.

It says the database is in an unrecognized format. The database may have been created with a later version.

I am using access 2000 you must be using 2002.


Thanks,
Linda
 
Linda -

Here is the Access 2000 version. To get an idea of the function after you export it from the zip double-click the icon and see if this is what you wanted to do... if it is then follow my instructions above. To bypass this function and get into the db hold down the shift key when you open the database to bypass the startup operations...

HTH,
Kev
 

Attachments

That is exactly what I am looking for. Ok I tried to do it and it is giving me the error message below.

Error accessing file. Network connection may have been lost.

So I opened your database and in the frmsplash code I changed the command to open my form instead of Switchboard. Then I imported my form in. When I tried to run it I got the same error message as above.
So I changed the code back to the original(Switchboard) and deleted my form which means it should be back to the original, tried to run it and still get the same error message as above. I didn't change anything else just what form the splash screen called up.

What am I missing?

Thanks,
Linda
 
Off the top of my head I'm not entirely sure but it sounds like a reference problem or perhaps something to do with the way you OS is setup. Can you post your db and I can take a look at it for you? If data security is a problem post a copy of the db without any data in it....

Kev
 
I tried to attach my db but it says the file is to large it's only 836kb I don't no why it won't accept it.

Can I email it to you?

Or should I copy and paste something here?

Thanks for all your help,

Linda
 
you can send me a copy:
 
Last edited:
Thank you Kevin for fixing my program. Everything is working great now!

Linda
 
Kevin - Can you help me too - I am trying to accomplish the same, but having varied results.

Thanks :)

Pat
 
Can you help me too - I am trying to accomplish the same, but having varied results

Pat - You need to be more specific as to what problems your having and/or it would be helpful for you to post a copy of your db so I/we can take a look at it...

Also*** Some members of this forum find it rude for members to directly email others seeking free help/advice unless offered by the ones helping... Not trying to scold ya, but I just wanted to let you know since your relatively new to this forum :D When you post to a thread the members currently involved in the thread discussion will be notified of new posts so they can kepp track of/respond to new posts so directly emailing members asking them to respond is not necessary.

If you post your problem and the db I will be happy to help you.

HTH,
Kev
 
I can't post the database, as it seems to large to attach to the BB. The problem I'm having is the same as most people I've read on the forum trying to implement the "hide access" trick, as outlined in the attached files in this thread. I want the database to boot up without the large Access Window, but just the small window surrounding the requested form. I have been able to accomplish this with my switchboard form that launches automatically, but when I attept to open other forms from that form, the application seems to either completely minimize (disappearing and only remaining in the task list) or crash. I imagine I'm coding something incorrectly - or my sloppy importation of the modules from the attached files was to blame.

Anyway, any insight? Here is the code I have implemented so far, thanks again for your help and I apologize again for the unsolicited e-mail.

The Form has this when it opens:

Code:
Private Sub Form_Open(Cancel As Integer)
SetAccessWindow (SW_HIDE)
End Sub

And then this is the module.

Code:
Option Compare Database

'Window modus const
Global Const SW_HIDE = 0
Global Const SW_SHOWNORMAL = 1
Global Const SW_SHOWMINIMIZED = 2
Global Const SW_SHOWMAXIMIZED = 3

'Private function
Private Declare Function apiShowWindow Lib "user32" _
Alias "ShowWindow" (ByVal hwnd As Long, _
ByVal windowModus As Long) As Long

Function SetAccessWindow(windowModus As Long)

Dim loX As Long
Dim currentForm As Form

On Error Resume Next

'Declaratie
Set currentForm = Screen.ActiveForm

If Err <> 0 Then
loX = apiShowWindow(hWndAccessApp, windowModus)
Err.Clear
End If

If windowModus = SW_SHOWMINIMIZED And currentForm.Modal = True Then
MsgBox "Cannot minimize Access with " & (currentForm.Caption + " ") & "form on screen"
ElseIf windowModus = SW_HIDE And currentForm.PopUp <> True Then
MsgBox "Cannot hide Access with " & (currentForm.Caption + " ") & "form on screen"
Else
loX = apiShowWindow(hWndAccessApp, windowModus)
End If

SetAccessWindow = (loX <> 0)

End Function
 
Last edited:
Pat -

First, no appologizes necessary - like I said I wasn't mad - just wanted to let you know that others sometimes get upset at that sort of thing...

Second, I believe that you are not seeing the other forms because you have not set their modal and index properties to yes. To do this you will need to go into design view for each form and - in properties under the 'Other' tab set modal and popup tp yes. This should take care of your problem. The reason your switchboard is appearing is that, by default, the switchboard has popup set to yes.

Let me know if this doesn't solve the problem...

HTH,
Kev
 
Last edited:
Unbelievable.

You are the MAN!

It worked like a charm - thank you _very_ much for that !
 
No problem Pat - glad I could help...

Good luck on the rest of your project,
Kevin
 
Kevin - Works for everything like a charm. Should I put different code to launch the reports? I set the reports to popup and modal "Yes", but they won't launch and minimize the program when I try.

Thanks again :)
 
Ahhh.... Reports!

The reason is that you can not view reports in 'Preview' mode without the Access window - so the reason your not seeing the reports pop-up is that they can't. This is one of the drawbacks to using this method (but I haven't found another method that works!) You can, however, just set your reports to print OR the work-around for this is to export the report to MS Word and open it in a sort of 'Preview' there. It works pretty much the same (not as fluid as opening them in the Access window) but works just the same. Plus from Word users can save, print, edit, etc... as usual.

OR OR - you could use crystal reports (if you have it) to handle your reporting...

Also of Note - this is just one draw back - there are more and are discussed in detail in the original thread on 'Hiding the Access Window' so if you want to make sure you've covered all of the possible pitfalls I'd check there too. Another important one to note (an mention here) is to make sure all of your code is error free as choosing 'Debug' from an error message will result in Access locking up!!

HTH and Good Luck,
Kev
 

Users who are viewing this thread

Back
Top Bottom