Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to pass a system message

Status
Not open for further replies.

231166

Programmer
Apr 5, 2005
104
FR
Hi,


A form called ListThesaurus is displayed in a form called 'thes_tree' when a user clicks on the menuitem'openthesaurus'of the thes_tree form.

In this form you can see a list of names of thesaurus.
When the user selects one thesaurus name, this thesaurus appears in the form'thes_tree'.

Now if the user does not select any thesaurus name but cliks on the button'ok' of the ListThesaurus form a system message appears and says the

I would like not see this system message appear but the message i have coded to appear.

Here is the code i use until now butit does not work well because the system message appears.

Code:
private Sub openthesaurus

frmListThesaurus as New ListThesaurus

With frmListThesaurus

.Connection = objConn

if .Show.Dialog=DialogResult.Ok then
intNumThes = .NumThesaurus

     if intNumThes<>Nothing then

'here you have the code to display all the terms of the thesaurus in a listview of the thes_tree form.


    else
          MessageBox.Show("you must choose a name of thesaurus")
Exit sub

End if 'end of if intNumThes<>nothing

End if 'end of if .showdialog= dialogresult.ok

frmListThesaurus=nothing

End sub

private sub menu_open_thesaurus_click

openthesaurus()

End Sub

If you could help me on this point it would be very kinfd from you.

Thanks a lot again.

Regards.

Nathalie

 
By "system message" you mean application error message?

I have noticed that you have the line:
if intNumThes<>Nothing then
The better use of checking for Nothing is to use:
Code:
If Not intNumThes Is Nothing Then
And this may/should correct your error...

Hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top