Show/Hide Access

ktrasler

Registered User.
Local time
Today, 01:17
Joined
Jan 9, 2007
Messages
39
Hi all

I have read various posts relating to this but can't find a solution to whats happening.

Basically, what I am doing is hiding access while a splash form is shown, then when the splash form is closed access is shown again.

here is the code (found on this forum)

Code:
Option Compare Database

Declare Function ShowWindow Lib "user32" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long

Public Const SW_HIDE = 0
Public Const SW_NORMAL = 1
Public Const SW_MIN = 2
Public Const SW_MAX = 3

Function ShowAccess()
      ShowWindow Application.hWndAccessApp, SW_MAX
End Function

Function HideAccess()
      ShowWindow Application.hWndAccessApp, SW_HIDE
End Function

The problem is that when access is shown again the menu bar is missing, although it is enabled?? It is just showing the database window. Having said this sometimes works ok.

This is nothing to do with showing the toolbars as they are all enabled. I have also gode code like to to ensure they all are enabled.

Code:
  Dim i As Integer
  For i = 1 To CommandBars.Count
    CommandBars(i).Enabled = True
  Next i

Is this just a glitch with using this type of code to hide access as if I close the DB and reopen using the shift key the toolbars are all there?

Regards

Kev
 
This is a glitch. I generally don't use the ShowWindow API with Access for this reason. You could use the MoveWindow API to move the application off the desktop during your update then move it back when your done.
 
Hi DJKarl

Thanks for you reply. At least I know that its not just me that has the problem. I have took it off for now, it wasn't really important.

I will look into the moveapi.

Cheers

Kev.
 
Novice needs idiot guide advice :-)

Hi Guys

I am a new member to this site and have been trawling for the last few days searching for an answer, which i think i have found . . . the problem is i don't have a clue where to start.

I have developed a database for work and during its first week a few members of staff decided to play around with it , so i am looking for a way to hide the access window, again the codes are on here but i don't know where to put them . . . sorry i know its lame but can anybody help and take pity on a novice. . please

Again my apologies but this is my first attempt with access !
 
Hi Guys

I am a new member to this site and have been trawling for the last few days searching for an answer, which i think i have found . . . the problem is i don't have a clue where to start.

I have developed a database for work and during its first week a few members of staff decided to play around with it , so i am looking for a way to hide the access window, again the codes are on here but i don't know where to put them . . . sorry i know its lame but can anybody help and take pity on a novice. . please

Again my apologies but this is my first attempt with access !

First off, welcome to the site.

Secondly, if you aren't sure where to put the code above then you really should think twice about deploying it. Using API calls can drastically increase Access's capabilities, but they can be tricky and you really need to use caution when implmenting them. That being said the code shown above would go into a public module.

Have you simply tried unchecking the displaay database window in the Startup section of your DB? Tools>Startup>Display Database Window
 
A deeper explanation

Thank you for the welcome and yeah i have tried disabling the menus in the startup options. The main reason is that although the database will, once rolled out, be our main work space for data entry, other users are moaning that they still need things on their desktop and its a pain to keep minimizing etc, (honestly, how long does it take, but there we are lol) so they want me to only have the form sitting on the desktop. I have come a long way in a short space of time, designing forms with combo buttons etc, granted basic but i am a quick learner !!

Thanks Again
 

Users who are viewing this thread

Back
Top Bottom