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!

Close Program Confirmation

Status
Not open for further replies.

no1biscuit

Programmer
Oct 8, 2001
67
US
I am wanting the customer to use the switchboard to go to the form they initally choose. Once there I have a combo box that allows them to navigate to the other forms (closing the form they are on). The only problem I have is that I need to close the switchboard and if they close whatever form they are on the display the switchboard. But if I put it on the unload event then everytime they swicht forms then switchboard jumps in the way. Any Ideas on how make the switchboard show up if they close the form not switch to a form causing a form unload event.

Thanks
Thom
 
I assume when you speak of them closing the form they're on, rather than going to another form via the combobox, you mean that they click on the big [X] at the top right hand side of the form to close it. If this is so, remove this Access native Close Button on each form and replace it with a custom Close Button.

In Design View for each form goto the form's

Properties => Format => Close Button and set it to NO.

Place a command button on the form, click on cancel to exit the Button Wizard. Goto the button's properties and click on the OnClick property then select code. You'll get taken to the sub for the OnClick event for the button. Enter this code:

Private Sub YourExitButton_Click()
DoCmd.OpenForm "YourSwitchboardName"
DoCmd.Close acForm, "YourCurrentFormName", acSaveYes
End Sub


Now the switchboard will only appear if the user closes a form using your custom close button, not when they close a form by switching to another form.

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
I will try that tonight. Thanks for the tip.

Thom


This site is awesome.....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top