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

close window

Status
Not open for further replies.

adwanoy

MIS
Apr 10, 2006
37
US
Hi all
how can you close the window after you exit an application, in order to return to desktop. you the window it has "File Window Help" on top left
 
Do you mean you just want the whole application, and not your particular database to close?

If so:

Create a button on your form that is labeled "Exit" or whatever you want to use. When you create the button, you should get a wizard option pop up asking what you want to do with the button. Choose "Application" then "Exit"

Or, just do it yourself on a button or whatever control you want to use:

Code:
Private Sub cmdExit()
  DoCmd.Quit
End Sub

You can add error handling if you do it on your own, and either way, you can add a message box if you want:

Code:
Private Sub cmdExit()
On Error GoTo Exit_ErrHandle
  
  Dim strMsg As String
  Dim strTitle As String
  strMsg = "Are you sure you want to exit the application?"
  strTitle = "Exit Now?"
 
  If MsgBox (strMsg, vbYesNo, strTitle_ = vbYes Then
    DoCmd.Quit
  End If

Exit Sub

Exit_ErrHandle
  MsgBox Err.Number & " " & Err.Description

End Sub

I hope one of those options are what you're looking for..
 
hey guys,
I think I have a anothe MS Access, even though it is 2003
but that what I had, docmd.quit but it always exit the form into the application window, I want to exit outside the application to the windows desktop
 
Try:

Application.Quit


TMTOWDI - it's not just for Perl any more
 
adalger,
thanks that works fine.
I still have the other problem, how to start a form in a specific location, and if possible in specific height
 
how to start a form in a specific location, and if possible in specific height
What about the DoCmd.MoveSize method ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
You mean you want to fix the location of your form on the screen? First, in Design View, go to the form's Properties Box and click on the Format Tab, then set Auto Center to NO. Next, move the form into the position on the screen you want. Finally, without doing anything else, click on Save, then immediately exit Access. When you next open the form it should be in the same position.

The Missinglinq

There's ALWAYS more than one way to skin a cat!
 
Missingling
thanks, but how in the world do move the form to any position? I mean, it always starts at top left! and dont forget it is a continuous form!
 
In Design View place your cursor in the form title bar (at top of form) Right Click and hold down right mouse button, then drag your form to position it on the screen. Being a contiuous form doesn't matter. You can still position it as you will. And don't forget, you can adjust the size of the form, whether a continuous form or not.

The Missinglinq

There's ALWAYS more than one way to skin a cat!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top