Is it possible to display a form without having to see the Microsoft Access Backdrop behind it? I just want to be able to click on the MDB and have it open directly to my first form without anything surround it.
Thanks kris,
I already have those set, what I would like to do is have Hide the ACCESS window that comes up by default, behind that form. I was told its possible to do this, but havent found it yet.
What you might try doing is set the forms PopUp property to yes. this will take it outside it's MDI parent window. If you set the Modal to true then this form has the mandatory focus till it is closed. However, this does not change the POP-UP nature of the form. If Modal is Yes and Pop-Up is no then the form is still in it's MDI container...
The PopUp property is in the 'forms' properties box i.e. double click in the upper left corner while in the form's 'design view' (little black square) Look under the 'Other' tab
What you might try doing is set the forms PopUp property to yes. this will take it outside it's MDI parent window. If you set the Modal to true then this form has the mandatory focus till it is closed. However, this does not change the POP-UP nature of the form. If Modal is Yes and Pop-Up is no then the form is still in it's MDI container...
The PopUp property is in the 'forms' properties box i.e. double click in the upper left corner while in the form's 'design view' (little black square) Look under the 'Other' tab
One more thing. In doing this you will be divorcing the MDI's Menu and Toolbar buttons from the form. If you need these you may not want to do this or you can try associating a separate custom Menu/Tool bar to the form.
I was also wondering if this was possible. I followed the above suggestions and set the form's pop-up and modal properties to 'yes'. However, as Lamar stated, I lose control of the Menu and Toolbar buttons. Thus I am not able to minimize the Access window. How would I go about hiding the Access window?
I've been controling the size of the window recently. Like setting up a permanent height and width, then fitting all the forms and report into window. That way you have access to everything you need. Mark P.
I too am having a similar problem; have tried all the above. My initial form comes up so that it fills the screen. The problem is that whether I use startup and name the the opening form, or use autoexec and have the form come up thru code, you still see the overall Access window for a second or two before the form loads.
Even with the db window deselected and having made a .mde file this background window is briefly visible.
THE Missinglinq "It's got to be the going,
not the getting there that's good!"
-Harry Chapin
It isnt actually possible to get rid of the access backdrop since it was created in that environment, however lamar's suggestion of using popUp gave me the ability to hide it. Setting modal will cause you to lose control, but popUp alone allows you to at least have a forms use, independant of the access backdrop.
With the pop-up idea, I had this working for a while, however had problems when it came to populating global variables.. basically it didn't populate them!
You can hide everything except your form with code. Make certain you won't have any possible "unhandled" errors generated by your DB as the Access window has to be open to generate the default error messages.
I can't give an attribution for the code as I don't immediately find where I first saw it.
Set the PopUp property of your forms to Yes
Set the On Open property of your main form to
1) select the open form and then
2) call a program.
_______________________________________________________
Sub Form_Open(Cancel As Integer)
DoCmd.SelectObject acForm, "Switchboard", False
Call fSetAccessWindow(SW_HIDE)
End Sub
______________________________________________________
This is the program you want to call.
______________________________________________________
Option Compare Database
Option Explicit
Global Const SW_HIDE = 0
Global Const SW_SHOWNORMAL = 1
Global Const SW_SHOWMINIMIZED = 2
Global Const SW_SHOWMAXIMIZED = 3
Private Declare Function apiShowWindow Lib "user32" _
Alias "ShowWindow" (ByVal hwnd As Long, _
ByVal nCmdShow As Long) As Long
Function fSetAccessWindow(nCmdShow As Long)
Dim loX As Long
Dim loForm As Form
On Error Resume Next
Set loForm = Screen.ActiveForm
If Err <> 0 Then 'no Activeform
If nCmdShow = SW_HIDE Then
MsgBox "Cannot hide Access unless " _
& "a form is on screen"
Else
loX = apiShowWindow(hWndAccessApp, nCmdShow)
Err.Clear
End If
Else
If nCmdShow = SW_SHOWMINIMIZED And loForm.Modal = True Then
MsgBox "Cannot minimize Access with " _
& (loForm.Caption + " " _
& "form on screen"
ElseIf nCmdShow = SW_HIDE And loForm.PopUp <> True Then
MsgBox "Cannot hide Access with " _
& (loForm.Caption + " " _
& "form on screen"
Else
loX = apiShowWindow(hWndAccessApp, nCmdShow)
End If
End If
fSetAccessWindow = (loX <> 0)
End Function
Kayle Lawrence
kaylaw1@mindspring.com
Kayle.Lawrence@ssa.gov
You may be able to write him to see about the problem.
Post back or e-mail me if you figure it out - we're migrating to Access 2002 in the next couple of months.
---Post continued after a little investigation---
I tried setting up a 2002 DB on one of our test machines. Running it as per my instrux above resulted in EVERYTHING (including the form) being hidden. I kept having to kill the msaccess process to get out of the DB. When I changed the form's Modal property to Yes, it worked as expected (although I haven't tried to use it with more than one form).
I'm not getting the error you describe when I paste the code or compile.
Have you tried creating a new DB, create the module, create the form (an exit button is handy), set the form's popup and modal properties to yes, for the on open event use the code:
Sub Form_Open(Cancel As Integer)
DoCmd.SelectObject acForm, "Switchboard", False
Call fSetAccessWindow(SW_HIDE)
End Sub
compiling this minimal DB and seeing if it works for you?
The error message almost sounds like you're putting the code in the code for the form, rather than in a separate module.
Let me know what you find out.
Incidentally, I'm running Access XP on Windows 2000, not WinXP - but doubt that has anything to do with it.
In order to get that background screen to not come up at the begining you have to set up a shortcut. Right click on the shortcut and change the windowmode to open minimized. pretty simple eh? You just have to make everyone use a short cut. Mark P.
markphsd,
Thank you for this entry. I have been trying to do this myself. What I have been doing was launching the application with a shell statement but I was using the shortcut 'Target' information to build my shell string. Well all I did was add the minimized statement to the shell statement and it worked well. thanks
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.