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

How do I disable the control box when a report is open

Status
Not open for further replies.

neemi

Programmer
May 14, 2002
519
0
0
GB
What i want to do is that when a user opens up a report I want to force them to use the customised toolbar option i have created to close the report rarther than closing it from the reports control box.#

Does any one know how to disable this or preferably even get rid of it from the report.

Also how do I disable the control box of the overal database.... to force the user to close the application using the options provided.

Cheers All.

Neemi
 
On pages 407-408 of the book "Alison Balter's Mastering Access 2002 Desktop Development", the following code should help you accomplish your objective:

Put this code in the "Activate" event for your report (or form?):
---------------------------------
Private Sub Report_Activate()
' Hide built-in Print Preview toolbar
DoCmd.ShowToolbar "Print Preview", acToolbarNo
' Show Custom Print Preview Toolbar
DoCmd.ShowToolbar "Custom Print Preview", acToolbarYes
End Sub
----------------------------------

and this code in the Deactivate event:
----------------------------------
Private Sub Report_Deactivate()
'Hide Custom Print Preveiw toolbar
DoCmd.ShowToolbar "Custom Print Preview", acToolbarNo
' Show built-in Print Preview toolbar
DoCmd.ShowToolbar "Print Preview", acToolbarWhere Approp
End Sub
----------------------------------

Notice that you RESTORE the standard toolbar "Where Appropriate"; you don't SHOW it. This puts the actual display of the toolbar back under Access' control. (You might not have focus when this executes.)

Good luck!
 
The line

DoCmd.ShowToolbar "Print Preview", acToolbarWhere Approp

give me a syntax error...

Any ideas

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top