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