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

access forms

Status
Not open for further replies.

krisme

Programmer
Nov 7, 2002
13
US
I have an access form. When I open this form I want to see only the form, not the MS access window behind it.

thanx in advance
 
Thank you. i tries u'r suggestion. Even if I make an empty menu bar of my own and substitute it for the menu bar, I still have window saying 'Microsoft Access' open behind my form. I want only the form to be displayed, nothing behind it. Any ideas???
 
Your answer is in the in the 3rd response in that thread.

Here it is re-outline

- Go to Tools - Startup
- Uncheck Display Database Window.
- Set the Display Form/Page to the form you want to display.

This will hide the database and only show the form.
 
I am referring to the main Microsoft Access window that is always open when u open an access form..the window with the menu bar and the tool bars..i want 'only' my form to be displayed, not within the main access window, but by itself..this is so that the form looks like a standalone windows application..
thank u for u'r patience..
 
You can set your main form to load maximized, which would take up the entire screen and not show the Access back.

In your forms On Load event put the following code:
DoCmd.Maximize

Then create a a custom menu bar as outlined in Thread703-559633.

This would display your form on the entire screen and would replace the standard Access menu bar with the custom one you created.

Hope this helps..
 
if i have'nt driven u nuts already, lemme try again..:)..

I don't want a menu bar or any window or bar other than my form to appear..no default menu, no customized menu, no access window, nothing except my form should be displayed..
the only window on the screen should be my form..no menu's, nothing except my form..help!!!!!!!
 
You can't get rid of the Access window. The only way around it is to maximize your form on load and set that form to open upon startup. You should also set your forms Pop Up property to yes and disable you forms min/max buttons. You can create your custom menu bar with nothing on it, which would give the affect of having no menu. If you would like a sample I can email you one, just provide me with your email address.
 
Here let me show you:
Place the following on the OnOpen event of a form that is the Startup Form for your application:

Private Sub Form_Open(Cancel As Integer)
DoCmd.SelectObject acForm, "FORMNAME", False
Call fSetAccessWindow(SW_HIDE)
End Sub

Do ALT+F11, click Insert, Module and copy and paste the following function: (Delete any duplicate Option statements)

Option Compare Database

'************ Code Start **********
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)
'Usage Examples
'Maximize window:
' ?fSetAccessWindow(SW_SHOWMAXIMIZED)
'Minimize window:
' ?fSetAccessWindow(SW_SHOWMINIMIZED)
'Hide window:
' ?fSetAccessWindow(SW_HIDE)
'Normal window:
' ?fSetAccessWindow(SW_SHOWNORMAL)
'
Dim loX As Long
Dim loForm As Form
On Error Resume Next
Set loForm = Screen.ActiveForm

loX = apiShowWindow(hWndAccessApp, nCmdShow)

fSetAccessWindow = (loX <> 0)
End Function

On the OnClose event of the form, place:

Private Sub Image13_Click()
DoCmd.Close acForm, &quot;Circle_Form&quot;
fSetAccessWindow (SW_SHOWMAXIMIZED)
End Sub

Neil

 
humble,
I tries u'r suggestions and it works.ie. i only see the form on the window. but now, if i have a button the form that opens another form, it does'nt work..
 
All your forms have to have their Popup properties set to yes.
And when you view a report, the Access window will come back...
 
I also have some buttons that run queries. when I click on these buttons, I get the results window. But, i have to move my master form to view the results windows which open behind the form. Is there a way to open these result windows to open infront of my main form, without again showing the access window??
 
box,
thanx..when i set all the form's popup properties to yes, they open fine..one of my forms has buttons that open Reports. These reports seem to be opening behind the forms and so canot be seen. Is there anything i can do to the reports that will display them upfront??
 
You may have to play around with the Visible property. You can place code in the reports Activate event that hides the main form and also place code in the reports Close event that unhides the main form. Something like below:

Reports Activate Event
On Error Resume Next
Forms!frmMainMenu.Visible = False

Reports Close Event
On Error Resume Next
Forms!frmMainMenu.Visible = True

Unfortunatly there is not a PopUp property for a report, so if the main form is set to PopUp you have to hide it in order to display the report.

 
thanx..i tries u'r suggestion, but i coud'nt get it to work..

my main form is a Switchboard named 'Switchboard', from which by clicking a button I open another form 'Letter'. It is from within 'Letter' that I click a button to open the report 'Labels LetterQuery'.
any pointers??
 
If you have both forms open at the time the report runs, you will have to hide both of them. The below code should go between the Private Sub and End Sub in your reports Activate and Close events.

Reports Activate Event
On Error Resume Next
Forms!Switchboard.Visible = False
Forms!Letter.Visible = False

Reports Close Event
On Error Resume Next
Forms!Switchboard.Visible = True
Forms!Letter.Visible = False
 
humble..i cannot thank u enough for all u'r help..
I tried u'r suggestion and it works..but, once i close the report and both the forms become visible, the form 'Letter', the one infront, just freezes..I cannot do anything on it like click a button or close it or anything...I can click buttons on the 'Switchboard' though. Also, if i make another selection on the 'Switchboard', like opening another form, then I cannot re-open 'Letter'.
 
It's hard to say what's causing this. It can be one of many things such as something in the reports Active or Close events or something in the 'Letter' button On Click event that opens the report. If you want to email me your database I will check it out. You can email it to gosmart@charter.net.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top