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

How to start an application with....... 1

Status
Not open for further replies.

legs00

Programmer
Oct 17, 2001
36
0
0
CA
Hi! I have an application on my desktop, and when I click to open it opens the form which I chose as my startup but I also have Access Application in the background. How do I get rid of the Access Application in the background and only have the form when I open my application.
Thanks Legs
 
The MDB/MDE files are dependant on MS ACCESS (I think that you call MS ACCESS "application").
Therefore you can not open a MDB/MDE without ACCESS.
All that you can do is hiding the database window and the standard menu/symbol bars in the ACCESS options window.
 
In the startup settings, below the startup form, de-select where it says Display Database Window.

bye

Martin.
 
So Francescina, what you are telling me is that I cannot start my application with a selected form and without the access application in the background like I would be able to do with visual basics.
 
Check this article. It tells how to hide or minimize the Access Window.

API: Manipulate Access Window
Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Hi Legs! Post this code to a stand alone Module! I got this code from a thread on this site many moons ago!

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

Call OpenStartup

End Function



Rich
 
The above code will hide the Access container!

Rich
 
What function is performed by the "OpenStartup" that's called at the end?
 
oops!! That is a function within my apps that check to see if my users are on the network. It has nothing to do with the above code!


Sorry for that


Regards


Rich
 
Hey Leggs,

Some folks like a ton o'code. I am not that sophisticated. It is easy to hide the database window with a macro. It needs to be named "AutoExec". Set the following actions:

RunCommand: WindowHide
OpenForm: Name Your Form
ShowToolbar: Form View: No

User can press F11 to view the database window however. I think you can disable this with code. I disable it with security features.

Best regards,

Henr¥
 
I feel that there is again some confusion.

The wonderful code of Rich will hide the complete ACCESS application window.
Henry's "code" will only hide the database window (sub-window of the ACCESS application).

In general I only hide the database window in my applications since hiding ACCESS requires extra coding lateron (and in some cases to strange memory management errors as soon as ressources are running low!).
 

I agree with Francescina's comment about hiding the DB window rather than the application window. For that reason, I suggested the link to the page at the MVPS.org site. That page provides code similar to that which Rich posted. The code has some comments which are helpful to someone who is learning VB. The page also contains a Warning of potential problems when hiding the application window. Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Thanks guys,

But the only thing that I an wondering is if I put this code in the form_Load() of my startup form.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top