On Close Event

  • Thread starter Thread starter heyyoucomovrhere
  • Start date Start date
H

heyyoucomovrhere

Guest
Ok, I've been using Access for about 6 years now and consider myself to be SOMEWHAT knowledgeable in this stuff. Now, this is what I have:

A form with a listbox with 5 columns. I am trying to open a report based on the row selected from the listbox. This works fine. Now, the twist, the report I am opening is in a SEPARATE database. So, I use all variables to open the database:

Docmd.OpenReport Me.ReportingListing.Column(2)

This works fine. Now, what I am trying to do, is set the "OnClick" event for the report I JUST opened. I have tried:

Me.ReportingListing.Column(2).OnClose="MyMacroName"

But, this doesn't work. And if anyone is wondering, the report is in a separate db because it is a report the USER has created on the fly in an ad hoc fashion. So, I import the report temporarily so that it may be shown and then deleted. However, I want to add a macro that tells the report to show my reports menu again once the report is closed.

Hopefully this makes sense. Thanks for the help.

Ciao

Mike
 
Hi Mike

Try something like this

Public Sub Test_OnClick(rpt_name As String)
Reports(rpt_name).OnClose = "Run_This_Macro"
End Sub

kaspi
 

Users who are viewing this thread

Back
Top Bottom