Solved

Continued combobox issue - integer entered into second form following combobox selection

Posted on 2013-01-29
3
231 Views
Last Modified: 2013-01-30
Hi-  Through much help, I received the following code.  


------------------------------------------------------
Public Class Form1

    Private WithEvents ObjForm As Form

    Dim Form2 As New Form2
------------------------------------------
Private Sub TypeComboBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TypeComboBox.SelectedIndexChanged

        Dim Int As Integer

        If TypeComboBox.SelectedItem = "NonProv" Then
            Int = 360

            If ObjForm Is Nothing Then ObjForm = New Form2(Int)

        End If

    End Sub
------------------------------------

    Private Sub Alarm_btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Alarm_btn.Click
        'the below connects the first form with the second form.  

        Form2.Show()

    End Sub
-----------------------------------
This did not present any problems, however now I am unable to access the second form from via the button click event.  I've tried many variations, but still no success.  Any advice?  Also, and more to the point, what am I not understanding?  

D.
0
Comment
Question by:RobertGeoff
3 Comments
 
LVL 18

Accepted Solution

by:
John (Yiannis) Toutountzoglou earned 420 total points
ID: 38833818
Try
Dim Int As Integer
Private Sub TypeComboBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TypeComboBox.SelectedIndexChanged

        

        If TypeComboBox.SelectedItem = "NonProv" Then
            Int = 360
        

        End If

    End Sub
------------------------------------

    Private Sub Alarm_btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Alarm_btn.Click
        'the below connects the first form with the second form.  

            If ObjForm Is Nothing Then ObjForm = New Form2(Int)
        ObjForm.ShowDialog

    End Sub
---------------------------------

Open in new window

0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 38834368
>however now I am unable to access the second form from via the button click event.

What you mean by that?
0
 

Author Closing Comment

by:RobertGeoff
ID: 38837558
jtoutou:
  Thanks for continuing to work with me.  Robert
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now