Results 1 to 2 of 2
  1. #1
    4 Star Lounger
    Join Date
    Feb 2002
    Thanked 0 Times in 0 Posts

    Cancel event with reports (Access 2000)

    I have copied a code that forbids using the Close button on the menu, and it is used with forms.
    I want to use this code with reports, even though the forms have no controls:

    ' This code prevents the form from closing
    ' if the CanClose poperty is False--to
    ' close the form the user must click the
    ' check box or OLE automation code must
    ' set the value of CanClose to True
    If Not Me.CanClose Then

    ' Cancel the close
    Cancel = True
    End If
    I have some other means to close the report.But what i cannot resolve, is that when i put the above code in the OnClose event of the

    report, i receive the message that Cancel is not known and that the cancel event is not applicable..How can i cancel the Close event with the same code but in the reports?

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Sacramento, California, USA
    Thanked 1 Time in 1 Post

    Re: Cancel event with reports (Access 2000)

    What CanClose property? You can cancel the Unload event of a form, not the close event, and there is no Unload event for a report. What is the point in trying to keep the user from closing the report?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts