How to run another form on error
I want to develope a form which call another form if any error occures
i am developing an application in which if first form dont get data from database then on error it call another data entry form and enters data to database and again start running first form from last resumed point
can anybody has idea , how can i do this?
code will help a lot
Thanks
Re: How to run another form on error
Thread moved from CodeBank forum (which is for code examples, not questions)
Welcome to VBForums :wave:
To do that you will need to have an error handler, see our Classic VB FAQ's (link in my signature) for an explanation of how to do that. You would then simply have code like: Form2.Show
It would be better tho to avoid the error in the first place.. if you show us your code, we can give you much better suggestions.
Re: How to run another form on error
In form 1 write
If (no data found)
Goto jumpToForm2
Else
End if
Exit sub
jumpToForm2:
Form2.Show
In form2 after inserting data unload the form2.
Re: How to run another form on error
:eek:
That does exactly the same thing as the following (which is much easier to read):
vb Code:
If (no data found) Then
Form2.Show
Else
'other code here?
End if
..as I mentioned above tho, we need to know more to be able to give a proper answer.
Re: How to run another form on error
And unless you are coding an Error Trap, forget GoTo exists.