Access 2007 crashes when canceling On No Data and calling function from On Close -


ms access 2007 (and perhaps later versions) appears have bug causes hard crash when report open canceled in on no data event , on close event contains call public function. not appear issue ms access 2003 or earlier.

steps reproduce:

  • create new report in ms access 2007 (this not issue in ms access 2003 , prior)
  • set recordsource (it can anything, must bound report)
  • set event on no data [event procedure]
  • in code module report, enter:

private sub report_nodata(cancel integer)`       cancel = true end sub 
  • set event on close =foo()
  • in standard code module, add following code:

public function foo() end function 
  • open report using filter excludes data (in order raise no data event)

results:

  • access suffers hard crash "access has stopped working..." error message

two questions:

  1. is there workaround?
  2. is known issue? (known microsoft or greater ms access community)

workaround

there couple of workarounds:

  • replace function call in report's on close property "[event procedure]" , call function within report's private sub report_close() in vba.

    - or -

  • move function call report's on close property on unload property. (note: on unload report property introduced ms access 2007)


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

jsf - How to ajax update an item in the footer of a PrimeFaces dataTable? -

django - CSRF verification failed. Request aborted. CSRF cookie not set -