To Imar: Re: Sub Main
Hi Imar,
A few posts ago, you helped me out with a situation where I needed to access controls and subroutines from form1. You provided me the solution to call Sub Main as my start up object.
I have run into some problems where Sub Main is being called for no apparent reason (to me anyways). As an example, I have the following identical code tied to 4 separate button_click events. All buttons except for one work as expected. On the excption button, once I press OK after the messagebox appears, form1 instance (which is my main app window) is closed and the application attempts to run Sub Main on the module. The bottom line is that the application shuts down. I have seen this happen on another event in my application as well.
My questions are:
1) What is happening and how can I fix this?
2) Why does it happen on only the one button out of 4 that have are running identical routines?
Your help would be truly appreciated.
Here is the code:
If nudTradeManagerAdjust.Value = 0 Then
MessageBox.Show("Please enter an adjustment value into the spinner.", "Message")
Exit Sub
End If
Ray
|