MDI Forms & Child forms 
Author Message
 MDI Forms & Child forms

Hi,

Quick question -

When I build my MDI Child I do some data validation that is being derived
from a dataset.  I the dataset comes across an error loading how can I stop
the child form completing - me.close doesn't cut it - found that one out the
hard way.

Doug



Sat, 02 Oct 2004 09:07:49 GMT  
 MDI Forms & Child forms
If I understand you correctly then you want the mdi child to close if an
error occurs on form load.

Put the following in the form load:

Try
    'load dataset
Catch 'error handling code if exception occurs in try
    Me.Close
Finally
     'code that you want to run under all circumstances (error or no error)
End Try

However I wouldn't load the dataset in the form load of the mdi child, I
think it's better to load the dataset in the background (e.g. if possible in
a splash screen) before loading the mdi child at all. Check the result again
with a Try Catch. And then load the mdi child only if no error occured
instead of aborting the load of the mdi child.


Quote:
> Hi,

> Quick question -

> When I build my MDI Child I do some data validation that is being derived
> from a dataset.  I the dataset comes across an error loading how can I
stop
> the child form completing - me.close doesn't cut it - found that one out
the
> hard way.

> Doug



Sat, 02 Oct 2004 20:04:18 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. MDI Form & Child Form Focus

2. Q: Form activate Fires On Non Child MDI Forms But Only Once On Child Mdi Forms

3. Modifying object in MDI Parent form from MDI Child form

4. Make a reference to a MDI form with a reference of a MDI child form

5. MDI-Child form and positon on MDI-form

6. Developing OLE MDI Child forms displayed on Control MDI Form

7. MDI child forms on top of a picture on a MDI form

8. Help with MDI Forms and MDI child forms

9. Modal non MDI forms and Modeless MDI child forms in VB 5.0

10. Allow MDI Child form to overlap Aligned Picture Box in MDI Form

11. Having MDI form with MDI Child form in DLL

12. Accessing Objects on a Mdi Parent form from a Mdi Child form

 

 
Powered by phpBB® Forum Software