Solved

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

Posted on 2013-01-29
3
227 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
Comment Utility
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
Comment Utility
>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
Comment Utility
jtoutou:
  Thanks for continuing to work with me.  Robert
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

771 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

11 Experts available now in Live!

Get 1:1 Help Now