Is the dialog form still loaded?
I am using Access 2010.
Some form A opens form B in dialog mode. When A gets control back from the call, B is either loaded or unloaded. If (and only if) B is loaded, A can access to the fields within B. How can A determine if B is loaded? [:confused:]
The no-brainer solution is to create a public variable (outside of B) that B can set and A can read. But, passing data through a global variable tightens the coupling between A and B. Instead of becoming a reusable, custom dialog box, B becomes anchored to A through the global variable.
Is there an IsLoaded(Form) Boolean function that can make the determination? Then, B can us IsForm(A) to make the determination.
Is there a way to get form B to propagate an error to A? The error would indicate that the form is no longer loaded. Then, A can handle the error from B. I was unable to get that to work. See below.
Is there a way A can pass a call by reference parameter to B? Then, A can provide an out parameter to B. Openargs lets you pass a string by value?
Here is what nappen when I tried the error propagation proposal.
If form B raises an error in Form_Close, control doesn’t resume at the A’s error handler.
In the VB Editor, under Tools->Options->General, the error trapping is set to “Break on Unhandled Errors”.
In the call stack, the Form_Open call is under the Form_Close subroutine making the raise call.
It behaves like the error is unhandled. But the caller has an error handler. I tested the handling mechanism by raising an error directly in Form_Open. The handler does function.
You may use a code like this
|All times are GMT -4. The time now is 11:57 AM.|
Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.