OnClose form property and macros

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I see that I can set an event or macro for "OnClose" property. But I want to delete an intermediate table that happens to be the one I am working on. Is there any way for me to have an AFTERCLOSE property? Access won't let me delete the table I'm working on.

My macro is supposed to run an append query taking the data from the formed table and tacking it on my logfile table. Then it's supposed to delete the intermediate table. Then, recreate the intermediate table's structure only by copying a blank similar table

Can someone help

Thanks
Derek
 
No, there is no AfterClose property.

You could work around this by inserting a SetValue action as the first step
of the macro in order to unbind the form from the temporary table, which
should let you do what you want then, because the table no longer would be
"in use" by the form.

Action: SetValue
Control Name: Forms!FormName.RecordSource
Expression: ""


Let me know if this isn't successful, and then we'll pursue slightly more
involved steps.

--
Ken Snell
<MS ACCESS MVP>

Derek Wittman said:
I see that I can set an event or macro for "OnClose" property. But I want
to delete an intermediate table that happens to be the one I am working on.
Is there any way for me to have an AFTERCLOSE property? Access won't let me
delete the table I'm working on.
My macro is supposed to run an append query taking the data from the
formed table and tacking it on my logfile table. Then it's supposed to
delete the intermediate table. Then, recreate the intermediate table's
structure only by copying a blank similar table.
 
Ken
Thanks for the pointer. I certainly would never have thought of resetting the RecordSource for the form - of course, after the append query is run. The macros for Submit and Cancel both work with this command (as you probably expect). Now, I need to set it up to only execute the select query for the records entered within, say, the last hour. This is how the users will get the control numbers for their requests. But that's a different newsgroup..

Thanks
Dere
----- Ken Snell wrote: ----

No, there is no AfterClose property

You could work around this by inserting a SetValue action as the first ste
of the macro in order to unbind the form from the temporary table, whic
should let you do what you want then, because the table no longer would b
"in use" by the form

Action: SetValu
Control Name: Forms!FormName.RecordSourc
Expression: "


Let me know if this isn't successful, and then we'll pursue slightly mor
involved steps

--
Ken Snel
<MS ACCESS MVP

Derek Wittman said:
I see that I can set an event or macro for "OnClose" property. But I wan
to delete an intermediate table that happens to be the one I am working on
Is there any way for me to have an AFTERCLOSE property? Access won't let m
delete the table I'm working onformed table and tacking it on my logfile table. Then it's supposed t
delete the intermediate table. Then, recreate the intermediate table'
structure only by copying a blank similar table
 
Back
Top