T
Tom
I inserted a Tab Control on my form.
As intended, most of my tabs provide the user information about records.
However, I also want to create a tab (blank page) that allows to EXIT the
application when being clicked on.
Unfortunately, I cannot EXIT the application as envisioned. Here's what I
have done:
- Inserted a command button (anywhere in the form) and used the Wizard to
create "Exit Application". The code for this is listed below:
*************************************************
Private Sub Command3_Click()
On Error GoTo Err_Command3_Click
DoCmd.Quit
Exit_Command3_Click:
Exit Sub
Err_Command3_Click:
MsgBox Err.Description
Resume Exit_Command3_Click
End Sub
*************************************************
- Copied/pasted the above code into the OnClick function of the Tab/Page
called EXIT (then renamed the "Command3" to the name of the tab ("EXIT").
- Again, unfortunaly, this approach does not seem to work... the application
is not exited when I click on the Exit page.
I also tried to move a regular command button next to a Page. This,
however, does not work either since the Tab Control "sits ontop" of the
command button so I can't see the button.
Does anyone have a recommendation as to how I could fix the problem? Or
maybe there's another "smooth" solution that I couldn't think of... any
recommendation is appreciated!
Thanks,
Tom
As intended, most of my tabs provide the user information about records.
However, I also want to create a tab (blank page) that allows to EXIT the
application when being clicked on.
Unfortunately, I cannot EXIT the application as envisioned. Here's what I
have done:
- Inserted a command button (anywhere in the form) and used the Wizard to
create "Exit Application". The code for this is listed below:
*************************************************
Private Sub Command3_Click()
On Error GoTo Err_Command3_Click
DoCmd.Quit
Exit_Command3_Click:
Exit Sub
Err_Command3_Click:
MsgBox Err.Description
Resume Exit_Command3_Click
End Sub
*************************************************
- Copied/pasted the above code into the OnClick function of the Tab/Page
called EXIT (then renamed the "Command3" to the name of the tab ("EXIT").
- Again, unfortunaly, this approach does not seem to work... the application
is not exited when I click on the Exit page.
I also tried to move a regular command button next to a Page. This,
however, does not work either since the Tab Control "sits ontop" of the
command button so I can't see the button.
Does anyone have a recommendation as to how I could fix the problem? Or
maybe there's another "smooth" solution that I couldn't think of... any
recommendation is appreciated!
Thanks,
Tom