Imports System.Data.SqlClient
Public Class frm_QAnVerify

    Dim conn As New SqlConnection(System.Configuration.ConfigurationSettings.AppSettings("SO_Conn"))
    Dim conn1 As New SqlConnection(System.Configuration.ConfigurationSettings.AppSettings("SO_Conn"))
    Dim cmd As SqlCommand = Nothing

    Dim im_location As String = "\\PINNACLE-SO\NCFiles"
    'Dim im_location As String = "C:\r_image\"
    'Dim im_location As String = "\\Pinnacle-so\SCANA\"
    'Dim im_location As String = "\\system-1\scana\"
    Dim im_loc As String
    Dim division As String

    Private Sub frm_QAnVerify_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Fill_ComboFields(cmb_loccd_1, "select distinct   isnull(STREET_LOCATION_1_CD,' ') as t_values from address order by t_values")
        'Dim AxPdf1 As AxAcroPDFLib.AxAcroPDF

        Fill_ComboFields(cmb_loccd_1, "SO_FrmqafillCombo")
        Fill_All_ComboBoxes()
        getfiledetail(getminfile_forQAnCheck())
        Label62.Visible = False
        txtreassignshow.Visible = False
    End Sub
    Function getminfile_forQAnCheck()
        Dim fileid As Integer
        If conn.State = 0 Then
            conn.Open()
        End If
        Dim sqlst As String = ""
        If rbt_qa.Checked = True Then
            'sqlst = "select ISNULL(min(file_id),0) from tbl_parent  where status = 'E'"
            sqlst = "SO_Getminfileqa"
        ElseIf rbt_nopremise.Checked = True Then
            sqlst = "SO_Getminfileqa1"
            'sqlst = "SELECT ISNULL(min(ts.file_id),0) FROM TBL_SERVICEWO TS, TBL_PARENT TP WHERE TS.FILE_ID = TP.FILE_ID AND TS.PREMISE_NO = '' AND TP.STATUS IN ('P', 'E')"
        ElseIf radbtnmissmatch.Checked = True Then
            sqlst = "SO_Getminfilemismatch"
        Else
            sqlst = "SO_Getminfileqa2"
            'sqlst = "select ISNULL(min(file_id),0) from tbl_parent  where status = 'P'"
        End If
        Dim dr As SqlDataReader = Nothing
        cmd = New SqlCommand(sqlst, conn)
        cmd.CommandType = CommandType.StoredProcedure
        dr = cmd.ExecuteReader(CommandBehavior.CloseConnection)
        If (dr.Read) Then
            fileid = CInt(dr(0).ToString)
        Else
            fileid = 0
        End If
        dr.Close()
        Return fileid
    End Function
    Function getnext_fileid(ByVal file_id As Integer)
        Dim fileid As Integer
        If conn.State = 0 Then
            conn.Open()
        End If
        Dim incr As Integer
        Try
            incr = CInt(Me.txt_increment.Text.Trim)
        Catch ex As Exception
            incr = 10
        End Try
        Dim sqlst As String = ""
        If rbt_qa.Checked = True Then
            sqlst = "SO_FrmQagetnextfile"
        ElseIf rbt_nopremise.Checked = True Then
            sqlst = "SO_FrmQagetnextfile1"
        ElseIf radbtnmissmatch.Checked = True Then
            sqlst = "SO_FrmQagetnextfileMismatch"
        Else
            sqlst = "SO_FrmQagetnextfile2"
        End If
        Dim dr As SqlDataReader = Nothing
        cmd = New SqlCommand(sqlst, conn)
        cmd.CommandType = CommandType.StoredProcedure
        If rbt_qa.Checked = True Then
            cmd.Parameters.AddWithValue("@fileid", file_id)
            cmd.Parameters.AddWithValue("@var", incr)
        ElseIf rbt_nopremise.Checked = True Or radbtnmissmatch.Checked = True Then
            cmd.Parameters.AddWithValue("@fileid", file_id)
        Else
            cmd.Parameters.AddWithValue("@fileid", file_id)
        End If
        dr = cmd.ExecuteReader(CommandBehavior.CloseConnection)
        If (dr.Read) Then
            fileid = CInt(dr(0).ToString)
        Else
            fileid = 0
        End If
        dr.Close()
        Return fileid
    End Function
    Function getlast_fileid(ByVal file_id As Integer)
        Dim fileid As Integer
        If conn.State = 0 Then
            conn.Open()
        End If
        Dim sqlst As String = ""
        If rbt_qa.Checked = True Then
            sqlst = "SO_GetlastFile"
            'sqlst = "select ISNULL(max(file_id),0) from tbl_parent  where status = 'E' and file_id > " & file_id
        ElseIf rbt_nopremise.Checked = True Then
            sqlst = "SO_GetlastFile1"
            'sqlst = "SELECT ISNULL(max(ts.file_id),0) FROM TBL_SERVICEWO TS, TBL_PARENT TP WHERE TS.FILE_ID = TP.FILE_ID AND TS.PREMISE_NO = '' AND TP.STATUS IN ('P', 'E') and ts.file_id > " & file_id
        ElseIf radbtnmissmatch.Checked = True Then
            sqlst = "SO_GetlastFileMismatch"
        Else
            sqlst = "SO_GetlastFile2"
            'sqlst = "select ISNULL(max(file_id),0) from tbl_parent  where status = 'P' and file_id > " & file_id
        End If
        Dim dr As SqlDataReader = Nothing
        cmd = New SqlCommand(sqlst, conn)
        cmd.CommandType = CommandType.StoredProcedure
        cmd.Parameters.AddWithValue("@Fileid", file_id)
        dr = cmd.ExecuteReader(CommandBehavior.CloseConnection)
        If (dr.Read) Then
            fileid = CInt(dr(0).ToString)
        Else
            fileid = 0
        End If
        dr.Close()
        Return fileid
    End Function
    Function getprev_fileid(ByVal file_id As Integer)
        Dim fileid As Integer
        If conn.State = 0 Then
            conn.Open()
        End If
        Dim sqlst As String = ""
        Dim incr As Integer
        Try
            incr = CInt(Me.txt_increment.Text.Trim)
        Catch ex As Exception
            incr = 10
        End Try
        If rbt_qa.Checked = True Then
            sqlst = "SO_FrmQagetprvfile"
        ElseIf rbt_nopremise.Checked = True Then
            sqlst = "SO_FrmQagetprvfile1"
        ElseIf radbtnmissmatch.Checked = True Then
            sqlst = "SO_FrmQagetprvfileMismatch"
        Else
            sqlst = "SO_FrmQagetprvfile2"
        End If
        Dim dr As SqlDataReader = Nothing
        cmd = New SqlCommand(sqlst, conn)
        cmd.CommandType = CommandType.StoredProcedure
        If rbt_qa.Checked = True Then
            cmd.Parameters.AddWithValue("@fileid", file_id)
            cmd.Parameters.AddWithValue("@var", incr)
        ElseIf rbt_nopremise.Checked = True Or radbtnmissmatch.Checked = True Then
            cmd.Parameters.AddWithValue("@fileid", file_id)
        Else
            cmd.Parameters.AddWithValue("@fileid", file_id)
        End If
        dr = cmd.ExecuteReader(CommandBehavior.CloseConnection)
        If (dr.Read) Then
            fileid = CInt(dr(0).ToString)
        Else
            fileid = 0
        End If
        dr.Close()
        Return fileid
    End Function
    Function getfirst_fileid(ByVal file_id As Integer)
        Dim fileid As Integer
        If conn.State = 0 Then
            conn.Open()
        End If
        Dim sqlst As String = ""
        If rbt_qa.Checked = True Then
            sqlst = "SO_Getfirstfile"
            'sqlst = "select ISNULL(min(file_id),0) from tbl_parent  where status = 'E' and file_id < " & file_id
        ElseIf rbt_nopremise.Checked = True Then
            sqlst = "SO_Getfirstfile1"
            'sqlst = "SELECT ISNULL(min(ts.file_id),0) FROM TBL_SERVICEWO TS, TBL_PARENT TP WHERE TS.FILE_ID = TP.FILE_ID AND TS.PREMISE_NO = '' AND TP.STATUS IN ('P', 'E') and ts.file_id < " & file_id
        ElseIf radbtnmissmatch.Checked = True Then
            sqlst = "SO_Getfirstfilemismatch"
        Else
            sqlst = "SO_Getfirstfile2"
            'sqlst = "select ISNULL(min(file_id),0) from tbl_parent  where status = 'P' and file_id < " & file_id
        End If
        Dim dr As SqlDataReader = Nothing
        cmd = New SqlCommand(sqlst, conn)
        cmd.CommandType = CommandType.StoredProcedure
        cmd.Parameters.AddWithValue("@Fileid", file_id)
        dr = cmd.ExecuteReader(CommandBehavior.CloseConnection)
        If (dr.Read) Then
            fileid = CInt(dr(0).ToString)
        Else
            fileid = 0
        End If
        dr.Close()
        Return fileid
    End Function
    Function get_premiseno(ByVal HOUSE_NO As String, ByVal ADDR_PREFIX_1 As String, ByVal ADDR_PREFIX_2 As String, ByVal STREET_NM As String, ByVal STREET_SUFFIX_CD As String)
        Dim PREMISE_NO As String = ""
        If conn.State = 0 Then
            conn.Open()
        End If
        Dim house As String
        Dim add_prefix1 As String
        Dim add_prefix2 As String
        Dim street As String
        Dim street_suf As String
        If HOUSE_NO.Trim.Length = 0 Then
            MsgBox("Address does not matches. Check it again.", MsgBoxStyle.Information, "Address Exception")
            PREMISE_NO = ""
            Return PREMISE_NO
            Exit Function
            house = ""
        Else
            ' house = " HOUSE_NO = '" & HOUSE_NO & "'"
            house = HOUSE_NO
        End If

        Dim cities As String = ""
        If txt_div.Text.Trim = "Durham" Then
            cities = "DURHAM"
        ElseIf txt_div.Text.Trim = "Asheville" Then
            cities = "ASHEVILLE"
        ElseIf txt_div.Text.Trim = "Gastonia" Then
            cities = "GASTONIA"
        ElseIf txt_div.Text.Trim = "Raleigh" Then
            cities = "RALEIGH"

        ElseIf txt_div.Text.Trim = "CENTRAL" Then
            'cities = "LOCAL_OFFICE_NO IN ('002' ,'005' ,'010', '008' ,'012' ,'014' ,'020' ,'053' ,'054' ,'083', '050' ) "
            cities = "CENTRAL"
        ElseIf txt_div.Text.Trim = "EASTERN" Then
            'cities = "LOCAL_OFFICE_NO IN ('073', '075', '076', '084', '085', '086' )"
            cities = "EASTERN"
        ElseIf txt_div.Text.Trim = "COASTAL" Then
            'cities = "LOCAL_OFFICE_NO IN ('087','088','094')"
            cities = "COASTAL"
        ElseIf txt_div.Text.Trim = "LOW COUNTRY" Then
            'cities = "LOCAL_OFFICE_NO IN ('042', '060', '061', '065','080')"
            cities = "LOW COUNTRY"
        ElseIf txt_div.Text.Trim = "SOUTHERN" Then
            'cities = "LOCAL_OFFICE_NO IN ('023','070', '071', '080','090','091', '020' ,'092','095')"
            cities = "SOUTHERN"
        ElseIf txt_div.Text.Trim = "WESTERN" Then
            'cities = "LOCAL_OFFICE_NO IN ('010', '011', '030', '031', '032', '033', '035', '050','052','055', '089')"
            cities = "WESTERN"
        End If

        If ADDR_PREFIX_1.Trim.Length = 0 Then
            add_prefix1 = ""
        Else
            add_prefix1 = ADDR_PREFIX_1
        End If
        If ADDR_PREFIX_2.Trim.Length = 0 Then
            add_prefix2 = ""
        Else
            add_prefix2 = ADDR_PREFIX_2
        End If
        If STREET_NM.Trim.Length = 0 Then
            street = ""
        Else
            street = STREET_NM
        End If
        If STREET_SUFFIX_CD.Trim.Length = 0 Then
            street_suf = ""
        Else
            street_suf = STREET_SUFFIX_CD
        End If
        Dim dr As SqlDataReader = Nothing
        'Dim sql1 As String = "select distinct TOWN_NM as t_values from Address  where " & house & " and " & add_prefix1 & " and " & add_prefix2 & "  and " & street & " and " & street_suf & " and " & cities
        Dim sql1 As String = "SO_FrmQagettownname"
        'cmd = New SqlCommand("select ISNULL(max(PREMISE_NO),0) from Address  where " & house & " and " & add_prefix1 & " and " & add_prefix2 & "  and " & street & " and " & street_suf & " and " & cities, conn)
        ' cmd = New SqlCommand("select ISNULL(max(PREMISE_NO),0), TOWN_NM from Address  where " & house & " and " & add_prefix1 & " and " & add_prefix2 & "  and " & street & " and " & street_suf & " and " & cities & " group by TOWN_NM ", conn)
        cmd = New SqlCommand("Get_premise_no", conn)
        cmd.CommandType = CommandType.StoredProcedure
        cmd.Parameters.AddWithValue("@HOUSE_NO", house)
        cmd.Parameters.AddWithValue("@ADDR_PREFIX_1", add_prefix1)
        cmd.Parameters.AddWithValue("@ADDR_PREFIX_2", add_prefix2)
        cmd.Parameters.AddWithValue("@STREET_NM", street)
        cmd.Parameters.AddWithValue("@STREET_SUFFIX_CD", street_suf)
        cmd.Parameters.AddWithValue("@divison", cities)

        dr = cmd.ExecuteReader(CommandBehavior.CloseConnection)

        Dim COUNT As Integer = 0
        If dr.HasRows Then
            filter_cities(sql1)
            While (dr.Read)
                If COUNT = 0 Then
                    PREMISE_NO = dr(0).ToString
                    set_city(dr(1).ToString)
                    ' MsgBox(dr(1).ToString, MsgBoxStyle.Information, "Address Exception")
                End If
                COUNT = COUNT + 1
                If COUNT = 2 Then
                    Exit While
                End If
            End While

            If COUNT > 1 Then
                PREMISE_NO = ""
                MsgBox("Multiple Address, Choose correct city .", MsgBoxStyle.Information, "Address Exception")
            End If
            'If dr(0).ToString = 0 Then
            '    MsgBox("Address does not matches. Check it again.", MsgBoxStyle.Information, "Address Exception")
            '    PREMISE_NO = ""
            'Else
            '    PREMISE_NO = dr(0).ToString
            'End If
        Else
            PREMISE_NO = ""
            filter_cities("SO_frmQaGetcombovalue")
            MsgBox("Address does not matches. Check it again.", MsgBoxStyle.Information, "Address Exception")
        End If
        dr.Close()
        Return PREMISE_NO
    End Function

    Private Sub set_city(ByVal city As String)
        '--100blk
        If cmb_formtype.Text.Trim = "FORM-100BLK" Then
            cmb_100b_city.Text = city
            '--100blk misc
        ElseIf cmb_formtype.Text.Trim = "FORM-100BLK-MISC" Then
            cmb_100b_m_city.Text = city
        '--200 block
        ElseIf cmb_formtype.Text.Trim = "FORM-200BLK" Then
            cmb_200b_city.Text = city

        ElseIf cmb_formtype.Text.Trim = "Yellow" Then
            cmb_y_city.Text = city
        ElseIf cmb_formtype.Text.Trim = "MISC" Then
            cmb_l_city.Text = city
        ElseIf cmb_formtype.Text.Trim = "ORIGINAL" Then
            cmb_q_city.Text = city
        ElseIf cmb_formtype.Text.Trim = "ORIGINAL-R" Then
            cmb_r_city.Text = city
        ElseIf cmb_formtype.Text.Trim = "ABANDON-II" Then
            cmb_a_city.Text = city
        ElseIf cmb_formtype.Text.Trim = "Form-X" Then
            cmb_x_city.Text = city
        ElseIf cmb_formtype.Text.Trim = "FORM-IX" Then
            cmb_9_city.Text = city
        ElseIf cmb_formtype.Text.Trim = "ABANDON-I" Then
            cmb_8_city.Text = city
        ElseIf cmb_formtype.Text.Trim = "Form-954" Then
            cmb_7_city.Text = city
        ElseIf cmb_formtype.Text.Trim = "Form-80I" Then
            cmb_6_city.Text = city
        ElseIf cmb_formtype.Text.Trim = "White" Then
            cmb_w_city.Text = city
        ElseIf cmb_formtype.Text.Trim = "Orange" Then
            cmb_3_city.Text = city
        ElseIf cmb_formtype.Text.Trim = "Form235-B-702" Then
            cmb_4_city.Text = city
        ElseIf cmb_formtype.Text.Trim = "OD-9-6-38" Then
            cmb_5_city.Text = city
        End If
    End Sub
    Private Sub filter_cities(ByVal sqls As String)
        '--100 block
        If cmb_formtype.Text.Trim = "FORM-100BLK" Then
            Fill_ComboFields(cmb_100b_city, sqls)
            '--FORM-100BLK-MISC
        ElseIf cmb_formtype.Text.Trim = "FORM-100BLK-MISC" Then
            Fill_ComboFields(cmb_100b_m_city, sqls)
            '--200 block
        ElseIf cmb_formtype.Text.Trim = "FORM-200BLK" Then
            Fill_ComboFields(cmb_200b_city, sqls)

        ElseIf cmb_formtype.Text.Trim = "Yellow" Then
            Fill_ComboFields(cmb_y_city, sqls)
        ElseIf cmb_formtype.Text.Trim = "MISC" Then
            Fill_ComboFields(cmb_l_city, sqls)
        ElseIf cmb_formtype.Text.Trim = "ORIGINAL" Then
            Fill_ComboFields(cmb_q_city, sqls)
        ElseIf cmb_formtype.Text.Trim = "ORIGINAL-R" Then
            Fill_ComboFields(cmb_r_city, sqls)
        ElseIf cmb_formtype.Text.Trim = "ABANDON-II" Then
            Fill_ComboFields(cmb_a_city, sqls)
        ElseIf cmb_formtype.Text.Trim = "Form-X" Then
            Fill_ComboFields(cmb_x_city, sqls)
        ElseIf cmb_formtype.Text.Trim = "FORM-IX" Then
            Fill_ComboFields(cmb_9_city, sqls)
        ElseIf cmb_formtype.Text.Trim = "ABANDON-I" Then
            Fill_ComboFields(cmb_8_city, sqls)
        ElseIf cmb_formtype.Text.Trim = "Form-954" Then
            Fill_ComboFields(cmb_7_city, sqls)
        ElseIf cmb_formtype.Text.Trim = "Form-80I" Then
            Fill_ComboFields(cmb_6_city, sqls)
        ElseIf cmb_formtype.Text.Trim = "White" Then
            Fill_ComboFields(cmb_w_city, sqls)
        ElseIf cmb_formtype.Text.Trim = "Orange" Then
            Fill_ComboFields(cmb_3_city, sqls)
        ElseIf cmb_formtype.Text.Trim = "Form235-B-702" Then
            Fill_ComboFields(cmb_4_city, sqls)
        ElseIf cmb_formtype.Text.Trim = "OD-9-6-38" Then
            Fill_ComboFields(cmb_5_city, sqls)
        End If
    End Sub
    Private Sub get_folder_str(ByVal file_id As Integer)
        If conn.State = 0 Then
            conn.Open()
        End If
        Dim dr2 As SqlDataReader = Nothing
        cmd = New SqlCommand("get_folder_str", conn)
        cmd.CommandType = CommandType.StoredProcedure
        cmd.Parameters.AddWithValue("@file_id", file_id)
        dr2 = cmd.ExecuteReader(CommandBehavior.CloseConnection)
        If (dr2.Read) Then
            Me.txt_folderstr.Text = " > " & dr2(0).ToString & " > " & dr2(1).ToString & " > " & dr2(2).ToString & " > " & dr2(3).ToString
        End If
        dr2.Close()
    End Sub
    Private Sub getfiledetail(ByVal file_id As Integer)
        If conn.State = 0 Then
            conn.Open()
        End If


        Try
            If file_id = 0 Then
                'AxPdf1.LoadFile("")

                AxPdf1.LoadFile(im_location & "no_image.pdf")
                getfiledata(file_id)
                Me.txt_fileid.Text = ""
                Me.txt_filedesc.Text = ""
                'pnl_orange.Visible = False
                'pnl_white.Visible = False
                'pnl_yellow.Visible = False
                'Panel4.Visible = False
                'Panel5.Visible = False
                'Panel6.Visible = False
                'Panel7.Visible = False
                'Panel8.Visible = False
                'Panel9.Visible = False
                'Panel10.Visible = False
                'Panela.Visible = False
                'Panell.Visible = False
                'Panelq.Visible = False
                'Panelr.Visible = False
                Exit Sub
            End If
        Catch ex As Exception

        End Try
        If radbtnmissmatch.Checked = True Then
            Label62.Visible = True
            txtreassignshow.Visible = True
            Dim dr2 As SqlDataReader = Nothing
            cmd = New SqlCommand("SO_MissmatchReassign", conn)
            cmd.CommandType = CommandType.StoredProcedure
            cmd.Parameters.AddWithValue("@fileid", file_id)


            dr2 = cmd.ExecuteReader(CommandBehavior.CloseConnection)
            If (dr2.Read) Then

                Me.txtreassignshow.Text = dr2(0).ToString

            End If
            dr2.Close()
        End If

        'Dim dr1 As SqlDataReader = Nothing
        'cmd = New SqlCommand("select file_id, File_name, status, file_type from tbl_parent  where file_id = " & file_id & " and assigned_to = " & commonUser.Common.uID, conn)
        'dr1 = cmd.ExecuteReader(CommandBehavior.CloseConnection)
        'If (dr1.Read) Then
        '    Me.txt_fileid.Text = CInt(dr1(0).ToString)
        '    Me.txt_filedesc.Text = dr1(1).ToString
        '    If dr1(3).ToString.Trim.Length > 0 Then
        '        division = dr1(3).ToString.Trim
        '        im_loc = im_location & dr1(3).ToString.Trim & "\"
        '    End If
        '    AxPdf1.LoadFile(im_loc & dr1(1).ToString)
        'End If
        If conn.State = 0 Then
            conn.Open()
        End If
        Dim did As Integer
        Dim dr1 As SqlDataReader = Nothing
        Try
            cmd = New SqlCommand("SO_FrmQagetfiledetails", conn)
            cmd.CommandType = CommandType.StoredProcedure
            cmd.Parameters.AddWithValue("@imglocation", im_location)
            cmd.Parameters.AddWithValue("@fileid", file_id)


            dr1 = cmd.ExecuteReader(CommandBehavior.CloseConnection)
            If (dr1.Read) Then
                Me.txt_fileid.Text = CInt(dr1(0).ToString)
                Me.txt_filedesc.Text = dr1(1).ToString
                txt_div.Text = dr1(3).ToString
                'AxPdf1.LoadFile(dr1(4).ToString)
                AxPdf1.LoadFile(im_location + dr1(4).ToString)
                AxPdf1.gotoFirstPage()
                AxPdf1.setZoom(50)
                lblAddRef.Text = "Add Ref:" + dr1(4).ToString.Substring(dr1(4).ToString.IndexOf("-"))
                did = CInt(dr1("dataentry_by").ToString)
                txt_depname.Text = ""
            End If
        Catch ex As Exception

        End Try
        dr1.Close()
        If txt_filedesc.Text.Trim <> "" Then
            check_dual_pdf(txt_filedesc.Text)
        End If
        Me.txt_depname.Text = getdep(did)
        getfiledata(file_id)
        get_folder_str(file_id)
    End Sub
    Private Sub check_dual_pdf(ByVal file_desc As String)
        If conn.State = 0 Then
            conn.Open()
        End If
        Dim drpdf As SqlDataReader = Nothing
        'cmd = New SqlCommand("select replace(substring(externalref,charindex('Page',externalref),25),'.tif','.pdf') from tbl_so_imagefiles where service_order = (select service_order from tbl_parent where file_id = " & Me.txt_fileid.Text.Trim & " ) and substring(externalref,charindex('Page',externalref),25) <> replace('" & file_desc & "','.pdf','.tif')", conn)
        cmd = New SqlCommand("SO_FrmQacheckdualpdf", conn)
        cmd.CommandType = CommandType.StoredProcedure
        cmd.Parameters.AddWithValue("@fileid", Me.txt_fileid.Text.Trim)
        cmd.Parameters.AddWithValue("@file_desc", file_desc)

        drpdf = cmd.ExecuteReader(CommandBehavior.CloseConnection)
        If (drpdf.Read) Then
            btn_flip.Enabled = True
            btn_flip2.Enabled = True
        Else
            btn_flip.Enabled = False
            btn_flip2.Enabled = False
        End If
        drpdf.Close()
    End Sub
    Private Function getdep(ByVal id As Integer)
        Dim depname As String = ""
        If conn.State = 0 Then
            conn.Open()
        End If
        Dim dr As SqlDataReader = Nothing
        cmd = New SqlCommand("SO_FrmQagetdep", conn)
        cmd.CommandType = CommandType.StoredProcedure
        cmd.Parameters.AddWithValue("@id", id)
        dr = cmd.ExecuteReader(CommandBehavior.CloseConnection)
        If (dr.Read) Then
            depname = dr(0).ToString
        End If
        dr.Close()
        Return depname
    End Function
    Private Sub cmb_formtype_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_formtype.SelectedIndexChanged
        If cmb_formtype.Text.Trim = "Yellow" Then
            pnl_yellow.Visible = True
            pnl_white.Visible = False
            pnl_orange.Visible = False
            Panel4.Visible = False
            Panel5.Visible = False
            Panel6.Visible = False
            Panel7.Visible = False
            Panel8.Visible = False
            Panel9.Visible = False
            Panel10.Visible = False
            Panela.Visible = False
            Panelq.Visible = False
            Panelr.Visible = False
            Panell.Visible = False
            Panel_100b.Visible = False
            Panel_200b.Visible = False
            Panel_100b_Misc.Visible = False

            'Panel visibilty for FORM-100BLK
        ElseIf cmb_formtype.Text.Trim = "FORM-100BLK" Then
            Panel_100b.Visible = True
            pnl_yellow.Visible = False
            pnl_white.Visible = False
            pnl_orange.Visible = False
            Panel4.Visible = False
            Panel5.Visible = False
            Panel6.Visible = False
            Panel7.Visible = False
            Panel8.Visible = False
            Panel9.Visible = False
            Panel10.Visible = False
            Panela.Visible = False
            Panelq.Visible = False
            Panelr.Visible = False
            Panell.Visible = False
            Panel_200b.Visible = False
            Panel_100b_Misc.Visible = False

        ElseIf cmb_formtype.Text.Trim = "FORM-100BLK-MISC" Then
            Panel_100b_Misc.Visible = True
            pnl_yellow.Visible = False
            pnl_white.Visible = False
            pnl_orange.Visible = False
            Panel4.Visible = False
            Panel5.Visible = False
            Panel6.Visible = False
            Panel7.Visible = False
            Panel8.Visible = False
            Panel9.Visible = False
            Panel10.Visible = False
            Panela.Visible = False
            Panelq.Visible = False
            Panelr.Visible = False
            Panell.Visible = False
            Panel_100b.Visible = False
            Panel_200b.Visible = False
            ''Dinesh Behera
        ElseIf cmb_formtype.Text.Trim = "FORM-200BLK" Then
            Panel_200b.Visible = True
            Panell.Visible = False
            Panelr.Visible = False
            Panelq.Visible = False
            Panela.Visible = False
            Panel10.Visible = False
            Panel9.Visible = False
            Panel8.Visible = False
            Panel7.Visible = False
            Panel6.Visible = False
            Panel5.Visible = False
            Panel4.Visible = False
            pnl_yellow.Visible = False
            pnl_white.Visible = False
            pnl_orange.Visible = False
            Panel_100b.Visible = False
            Panel_100b_Misc.Visible = False

        ElseIf cmb_formtype.Text.Trim = "White" Then
            pnl_white.Visible = True
            pnl_yellow.Visible = False
            pnl_orange.Visible = False
            Panel4.Visible = False
            Panel5.Visible = False
            Panel6.Visible = False
            Panel7.Visible = False
            Panel8.Visible = False
            Panel9.Visible = False
            Panel10.Visible = False
            Panela.Visible = False
            Panelq.Visible = False
            Panelr.Visible = False
            Panell.Visible = False
            Panel_100b.Visible = False
            Panel_200b.Visible = False
            Panel_100b_Misc.Visible = False
        ElseIf cmb_formtype.Text.Trim = "Orange" Then
            pnl_orange.Visible = True
            pnl_yellow.Visible = False
            pnl_white.Visible = False
            Panel4.Visible = False
            Panel5.Visible = False
            Panel6.Visible = False
            Panel7.Visible = False
            Panel8.Visible = False
            Panel9.Visible = False
            Panel10.Visible = False
            Panela.Visible = False
            Panelq.Visible = False
            Panelr.Visible = False
            Panell.Visible = False
            Panel_100b.Visible = False
            Panel_200b.Visible = False
            Panel_100b_Misc.Visible = False
        ElseIf cmb_formtype.Text.Trim = "Form235-B-702" Then
            Panel4.Visible = True
            Me.pnl_yellow.Visible = False
            Me.pnl_white.Visible = False
            Me.pnl_orange.Visible = False
            Panel5.Visible = False
            Panel6.Visible = False
            Panel7.Visible = False
            Panel8.Visible = False
            Panel9.Visible = False
            Panel10.Visible = False
            Panela.Visible = False
            Panelq.Visible = False
            Panelr.Visible = False
            Panell.Visible = False
            Panel_100b.Visible = False
            Panel_200b.Visible = False
            Panel_100b_Misc.Visible = False
        ElseIf cmb_formtype.Text.Trim = "OD-9-6-38" Then
            Panel5.Visible = True
            Panel4.Visible = False
            Me.pnl_yellow.Visible = False
            Me.pnl_white.Visible = False
            Me.pnl_orange.Visible = False
            Panel6.Visible = False
            Panel7.Visible = False
            Panel8.Visible = False
            Panel9.Visible = False
            Panel10.Visible = False
            Panela.Visible = False
            Panelq.Visible = False
            Panelr.Visible = False
            Panell.Visible = False
            Panel_100b.Visible = False
            Panel_200b.Visible = False
            Panel_100b_Misc.Visible = False
        ElseIf cmb_formtype.Text.Trim = "Form-80I" Then
            Panel6.Visible = True
            Panel5.Visible = False
            Panel4.Visible = False
            pnl_yellow.Visible = False
            pnl_white.Visible = False
            pnl_orange.Visible = False
            Panel7.Visible = False
            Panel8.Visible = False
            Panel9.Visible = False
            Panel10.Visible = False
            Panela.Visible = False
            Panelq.Visible = False
            Panelr.Visible = False
            Panell.Visible = False
            Panel_100b.Visible = False
            Panel_200b.Visible = False
            Panel_100b_Misc.Visible = False
        ElseIf cmb_formtype.Text.Trim = "Form-954" Then
            Panel7.Visible = True
            Panel6.Visible = False
            Panel5.Visible = False
            Panel4.Visible = False
            pnl_yellow.Visible = False
            pnl_white.Visible = False
            pnl_orange.Visible = False
            Panel8.Visible = False
            Panel9.Visible = False
            Panel10.Visible = False
            Panela.Visible = False
            Panelq.Visible = False
            Panelr.Visible = False
            Panell.Visible = False
            Panel_100b.Visible = False
            Panel_200b.Visible = False
            Panel_100b_Misc.Visible = False
        ElseIf cmb_formtype.Text.Trim = "ABANDON-I" Then
            Panel8.Visible = True
            Panel7.Visible = False
            Panel6.Visible = False
            Panel5.Visible = False
            Panel4.Visible = False
            pnl_yellow.Visible = False
            pnl_white.Visible = False
            pnl_orange.Visible = False
            Panel9.Visible = False
            Panel10.Visible = False
            Panela.Visible = False
            Panelq.Visible = False
            Panelr.Visible = False
            Panell.Visible = False
            Panel_100b.Visible = False
            Panel_200b.Visible = False
            Panel_100b_Misc.Visible = False
        ElseIf cmb_formtype.Text.Trim = "FORM-IX" Then
            Panel9.Visible = True
            Panel8.Visible = False
            Panel7.Visible = False
            Panel6.Visible = False
            Panel5.Visible = False
            Panel4.Visible = False
            pnl_yellow.Visible = False
            pnl_white.Visible = False
            pnl_orange.Visible = False
            Panel10.Visible = False
            Panela.Visible = False
            Panelq.Visible = False
            Panelr.Visible = False
            Panell.Visible = False
            Panel_100b.Visible = False
            Panel_200b.Visible = False
            Panel_100b_Misc.Visible = False
        ElseIf cmb_formtype.Text.Trim = "Form-X" Then
            Panel10.Visible = True
            Panel9.Visible = False
            Panel8.Visible = False
            Panel7.Visible = False
            Panel6.Visible = False
            Panel5.Visible = False
            Panel4.Visible = False
            pnl_yellow.Visible = False
            pnl_white.Visible = False
            pnl_orange.Visible = False
            Panela.Visible = False
            Panelq.Visible = False
            Panelr.Visible = False
            Panell.Visible = False
            Panel_100b.Visible = False
            Panel_200b.Visible = False
            Panel_100b_Misc.Visible = False
        ElseIf cmb_formtype.Text.Trim = "ABANDON-II" Then
            Panela.Visible = True
            Panel10.Visible = False
            Panel9.Visible = False
            Panel8.Visible = False
            Panel7.Visible = False
            Panel6.Visible = False
            Panel5.Visible = False
            Panel4.Visible = False
            pnl_yellow.Visible = False
            pnl_white.Visible = False
            pnl_orange.Visible = False
            Panelq.Visible = False
            Panelr.Visible = False
            Panell.Visible = False
            Panel_100b.Visible = False
            Panel_200b.Visible = False
            Panel_100b_Misc.Visible = False
        ElseIf cmb_formtype.Text.Trim = "ORIGINAL" Then
            Panelq.Visible = True
            Panela.Visible = False
            Panel10.Visible = False
            Panel9.Visible = False
            Panel8.Visible = False
            Panel7.Visible = False
            Panel6.Visible = False
            Panel5.Visible = False
            Panel4.Visible = False
            pnl_yellow.Visible = False
            pnl_white.Visible = False
            pnl_orange.Visible = False
            Panelr.Visible = False
            Panell.Visible = False
            Panel_100b.Visible = False
            Panel_200b.Visible = False
            Panel_100b_Misc.Visible = False
        ElseIf cmb_formtype.Text.Trim = "ORIGINAL-R" Then
            Panelr.Visible = True
            Panelq.Visible = False
            Panela.Visible = False
            Panel10.Visible = False
            Panel9.Visible = False
            Panel8.Visible = False
            Panel7.Visible = False
            Panel6.Visible = False
            Panel5.Visible = False
            Panel4.Visible = False
            pnl_yellow.Visible = False
            pnl_white.Visible = False
            pnl_orange.Visible = False
            Panell.Visible = False
            Panel_100b.Visible = False
            Panel_200b.Visible = False
            Panel_100b_Misc.Visible = False
        ElseIf cmb_formtype.Text.Trim = "MISC" Then
            Panell.Visible = True
            Panelr.Visible = False
            Panelq.Visible = False
            Panela.Visible = False
            Panel10.Visible = False
            Panel9.Visible = False
            Panel8.Visible = False
            Panel7.Visible = False
            Panel6.Visible = False
            Panel5.Visible = False
            Panel4.Visible = False
            pnl_yellow.Visible = False
            pnl_white.Visible = False
            pnl_orange.Visible = False
            Panel_100b.Visible = False
            Panel_200b.Visible = False
            Panel_100b_Misc.Visible = False

        End If
        Fill_All_ComboBoxes()
        resetfiledata()
    End Sub
    'Private Sub Fill_All_ComboBoxes()
    '    If cmb_formtype.Text.Trim = "Yellow" Then
    '        Fill_ComboFields(cmb_y_pipesize, "select t_values from tbl_setup where s_types = 'PIPE SIZE'")
    '        Fill_ComboFields(cmb_y_pipekind, "select t_values from tbl_setup where s_types = 'PIPE TYPE'")
    '        Fill_ComboFields(cmb_y_tapzize, "select t_values from tbl_setup where s_types = 'TAP SIZE'")
    '        Fill_ComboFields(cmb_y_mainsize, "select t_values from tbl_setup where s_types = 'MAIN SIZE'")
    '        Fill_ComboFields(cmb_y_maintype, "select t_values from tbl_setup where s_types = 'MAIN TYPE'")
    '        Fill_ComboFields(cmb_y_testedwith, "select t_values from tbl_setup where s_types = 'TESTED WITH'")
    '        Fill_ComboFields(cmb_y_testedto, "select t_values from tbl_setup where s_types = 'TESTED TO'")
    '        Fill_ComboFields(cmb_y_city, "select t_values from tbl_setup where s_types = 'CITY'")
    '        Fill_ComboFields(cmb_y_pressure, "select t_values from tbl_setup where s_types = 'PRESSURE'")
    '        Fill_ComboFields(cmb_y_add2, "select distinct   isnull(ADDR_PREFIX_1,' ') as t_values from address")
    '        Fill_ComboFields(cmb_y_add2_1, "select distinct  isnull(ADDR_PREFIX_2,' ') as t_values  from address")
    '        Fill_ComboFields(cmb_y_add4_1, "select distinct  isnull(ADDR_SUFFIX_CD,' ') as t_values  from address")
    '        Fill_ComboFields(cmb_y_add4, "select distinct  isnull(STREET_SUFFIX_CD,' ') as t_values  from address")

    '    ElseIf cmb_formtype.Text.Trim = "MISC" Then

    '        Fill_ComboFields(cmb_l_city, "select t_values from tbl_setup where s_types = 'CITY'")

    '        Fill_ComboFields(cmb_l_add2, "select distinct   isnull(ADDR_PREFIX_1,' ') as t_values from address")
    '        Fill_ComboFields(cmb_l_add2_1, "select distinct  isnull(ADDR_PREFIX_2,' ') as t_values  from address")
    '        Fill_ComboFields(cmb_l_add4_1, "select distinct  isnull(ADDR_SUFFIX_CD,' ') as t_values  from address")
    '        Fill_ComboFields(cmb_l_add4, "select distinct  isnull(STREET_SUFFIX_CD,' ') as t_values  from address")




    '    ElseIf cmb_formtype.Text.Trim = "ORIGINAL" Then
    '        Fill_ComboFields(cmb_q_pipesize, "select t_values from tbl_setup where s_types = 'PIPE SIZE'")
    '        Fill_ComboFields(cmb_q_pipekind, "select t_values from tbl_setup where s_types = 'PIPE TYPE'")

    '        Fill_ComboFields(cmb_q_mainsize, "select t_values from tbl_setup where s_types = 'MAIN SIZE'")
    '        Fill_ComboFields(cmb_q_maintype, "select t_values from tbl_setup where s_types = 'MAIN TYPE'")
    '        Fill_ComboFields(cmb_q_testedwith, "select t_values from tbl_setup where s_types = 'TESTED WITH'")
    '        Fill_ComboFields(cmb_q_testedto, "select t_values from tbl_setup where s_types = 'TESTED TO'")
    '        Fill_ComboFields(cmb_q_city, "select t_values from tbl_setup where s_types = 'CITY'")

    '        Fill_ComboFields(cmb_q_add2, "select distinct   isnull(ADDR_PREFIX_1,' ') as t_values from address")
    '        Fill_ComboFields(cmb_q_add2_1, "select distinct  isnull(ADDR_PREFIX_2,' ') as t_values  from address")
    '        Fill_ComboFields(cmb_q_add4_1, "select distinct  isnull(ADDR_SUFFIX_CD,' ') as t_values  from address")
    '        Fill_ComboFields(cmb_q_add4, "select distinct  isnull(STREET_SUFFIX_CD,' ') as t_values  from address")


    '        Fill_ComboFields(cmb_q_coating, "select t_values from tbl_setup where s_types = 'Type_of_coating'")


    '    ElseIf cmb_formtype.Text.Trim = "ORIGINAL-R" Then
    '        Fill_ComboFields(cmb_r_pipesize, "select t_values from tbl_setup where s_types = 'PIPE SIZE'")
    '        Fill_ComboFields(cmb_r_pipekind, "select t_values from tbl_setup where s_types = 'PIPE TYPE'")

    '        Fill_ComboFields(cmb_r_mainsize, "select t_values from tbl_setup where s_types = 'MAIN SIZE'")
    '        Fill_ComboFields(cmb_r_maintype, "select t_values from tbl_setup where s_types = 'MAIN TYPE'")
    '        Fill_ComboFields(cmb_r_testedwith, "select t_values from tbl_setup where s_types = 'TESTED WITH'")
    '        Fill_ComboFields(cmb_r_testedto, "select t_values from tbl_setup where s_types = 'TESTED TO'")
    '        Fill_ComboFields(cmb_r_city, "select t_values from tbl_setup where s_types = 'CITY'")

    '        Fill_ComboFields(cmb_r_add2, "select distinct   isnull(ADDR_PREFIX_1,' ') as t_values from address")
    '        Fill_ComboFields(cmb_r_add2_1, "select distinct  isnull(ADDR_PREFIX_2,' ') as t_values  from address")
    '        Fill_ComboFields(cmb_r_add4_1, "select distinct  isnull(ADDR_SUFFIX_CD,' ') as t_values  from address")
    '        Fill_ComboFields(cmb_r_add4, "select distinct  isnull(STREET_SUFFIX_CD,' ') as t_values  from address")


    '        Fill_ComboFields(cmb_r_connection_data, "select t_values from tbl_setup where s_types = 'connection_data'")

    '    ElseIf cmb_formtype.Text.Trim = "ABANDON-II" Then

    '        Fill_ComboFields(cmb_a_mainsize, "select t_values from tbl_setup where s_types = 'MAIN SIZE'")
    '        Fill_ComboFields(cmb_a_maintype, "select t_values from tbl_setup where s_types = 'MAIN TYPE'")
    '        Fill_ComboFields(cmb_a_testedwith, "select t_values from tbl_setup where s_types = 'TESTED WITH'")

    '        Fill_ComboFields(cmb_a_city, "select t_values from tbl_setup where s_types = 'CITY'")

    '        Fill_ComboFields(cmb_a_add2, "select distinct   isnull(ADDR_PREFIX_1,' ') as t_values from address")
    '        Fill_ComboFields(cmb_a_add2_1, "select distinct  isnull(ADDR_PREFIX_2,' ') as t_values  from address")
    '        Fill_ComboFields(cmb_a_add4_1, "select distinct  isnull(ADDR_SUFFIX_CD,' ') as t_values  from address")
    '        Fill_ComboFields(cmb_a_add4, "select distinct  isnull(STREET_SUFFIX_CD,' ') as t_values  from address")
    '        Fill_ComboFields(cmb_a_reasonabandon, "select t_values from tbl_setup where s_types = 'Reason_of_abandon'")


    '    ElseIf cmb_formtype.Text.Trim = "Form-X" Then
    '        Fill_ComboFields(cmb_x_pipesize, "select t_values from tbl_setup where s_types = 'PIPE SIZE'")
    '        Fill_ComboFields(cmb_x_pipekind, "select t_values from tbl_setup where s_types = 'PIPE TYPE'")

    '        Fill_ComboFields(cmb_x_mainsize, "select t_values from tbl_setup where s_types = 'MAIN SIZE'")
    '        Fill_ComboFields(cmb_x_maintype, "select t_values from tbl_setup where s_types = 'MAIN TYPE'")
    '        Fill_ComboFields(cmb_x_testedwith, "select t_values from tbl_setup where s_types = 'TESTED WITH'")
    '        Fill_ComboFields(cmb_x_testedto, "select t_values from tbl_setup where s_types = 'TESTED TO'")
    '        Fill_ComboFields(cmb_x_city, "select t_values from tbl_setup where s_types = 'CITY'")

    '        Fill_ComboFields(cmb_x_add2, "select distinct   isnull(ADDR_PREFIX_1,' ') as t_values from address")
    '        Fill_ComboFields(cmb_x_add2_1, "select distinct  isnull(ADDR_PREFIX_2,' ') as t_values  from address")
    '        Fill_ComboFields(cmb_x_add4_1, "select distinct  isnull(ADDR_SUFFIX_CD,' ') as t_values  from address")
    '        Fill_ComboFields(cmb_x_add4, "select distinct  isnull(STREET_SUFFIX_CD,' ') as t_values  from address")
    '        Fill_ComboFields(cmb_x_coating, "select t_values from tbl_setup where s_types = 'Type_of_coating'")

    '    ElseIf cmb_formtype.Text.Trim = "FORM-IX" Then
    '        Fill_ComboFields(cmb_9_pipesize, "select t_values from tbl_setup where s_types = 'PIPE SIZE'")
    '        Fill_ComboFields(cmb_9_pipekind, "select t_values from tbl_setup where s_types = 'PIPE TYPE'")
    '        Fill_ComboFields(cmb_9_tapzize, "select t_values from tbl_setup where s_types = 'TAP SIZE'")
    '        Fill_ComboFields(cmb_9_mainsize, "select t_values from tbl_setup where s_types = 'MAIN SIZE'")
    '        Fill_ComboFields(cmb_9_maintype, "select t_values from tbl_setup where s_types = 'MAIN TYPE'")
    '        Fill_ComboFields(cmb_9_city, "select t_values from tbl_setup where s_types = 'CITY'")
    '        Fill_ComboFields(cmb_9_add2, "select distinct   isnull(ADDR_PREFIX_1,' ') as t_values from address")
    '        Fill_ComboFields(cmb_9_add2_1, "select distinct  isnull(ADDR_PREFIX_2,' ') as t_values  from address")
    '        Fill_ComboFields(cmb_9_add4_1, "select distinct  isnull(ADDR_SUFFIX_CD,' ') as t_values  from address")
    '        Fill_ComboFields(cmb_9_add4, "select distinct  isnull(STREET_SUFFIX_CD,' ') as t_values  from address")
    '        Fill_ComboFields(cmb_9_coating, "select t_values from tbl_setup where s_types = 'Type_of_coating'")
    '    ElseIf cmb_formtype.Text.Trim = "ABANDON-I" Then
    '        Fill_ComboFields(cmb_8_mainsize, "select t_values from tbl_setup where s_types = 'MAIN SIZE'")
    '        Fill_ComboFields(cmb_8_maintype, "select t_values from tbl_setup where s_types = 'MAIN TYPE'")
    '        Fill_ComboFields(cmb_8_city, "select t_values from tbl_setup where s_types = 'CITY'")
    '        Fill_ComboFields(cmb_8_add2, "select distinct   isnull(ADDR_PREFIX_1,' ') as t_values from address")
    '        Fill_ComboFields(cmb_8_add2_1, "select distinct  isnull(ADDR_PREFIX_2,' ') as t_values  from address")
    '        Fill_ComboFields(cmb_8_add4_1, "select distinct  isnull(ADDR_SUFFIX_CD,' ') as t_values  from address")
    '        Fill_ComboFields(cmb_8_add4, "select distinct  isnull(STREET_SUFFIX_CD,' ') as t_values  from address")
    '        Fill_ComboFields(cmb_8_coating, "select t_values from tbl_setup where s_types = 'Type_of_coating'")
    '    ElseIf cmb_formtype.Text.Trim = "Form-954" Then
    '        Fill_ComboFields(cmb_7_pipesize, "select t_values from tbl_setup where s_types = 'PIPE SIZE'")
    '        Fill_ComboFields(cmb_7_pipekind, "select t_values from tbl_setup where s_types = 'PIPE TYPE'")
    '        Fill_ComboFields(cmb_7_tapzize, "select t_values from tbl_setup where s_types = 'TAP SIZE'")
    '        Fill_ComboFields(cmb_7_mainsize, "select t_values from tbl_setup where s_types = 'MAIN SIZE'")
    '        Fill_ComboFields(cmb_7_maintype, "select t_values from tbl_setup where s_types = 'MAIN TYPE'")
    '        Fill_ComboFields(cmb_7_city, "select t_values from tbl_setup where s_types = 'CITY'")
    '        Fill_ComboFields(cmb_7_add2, "select distinct   isnull(ADDR_PREFIX_1,' ') as t_values from address")
    '        Fill_ComboFields(cmb_7_add2_1, "select distinct  isnull(ADDR_PREFIX_2,' ') as t_values  from address")
    '        Fill_ComboFields(cmb_7_add4_1, "select distinct  isnull(ADDR_SUFFIX_CD,' ') as t_values  from address")
    '        Fill_ComboFields(cmb_7_add4, "select distinct  isnull(STREET_SUFFIX_CD,' ') as t_values  from address")
    '        Fill_ComboFields(cmb_7_naturework, "select t_values from tbl_setup where s_types = 'Nature_of_work'")
    '        Fill_ComboFields(cmb_7_kindjoint, "select t_values from tbl_setup where s_types = 'Kind_of_joint'")
    '        Fill_ComboFields(cmb_7_coating, "select t_values from tbl_setup where s_types = 'Type_of_coating'")
    '    ElseIf cmb_formtype.Text.Trim = "Form-80I" Then
    '        Fill_ComboFields(cmb_6_pipesize, "select t_values from tbl_setup where s_types = 'PIPE SIZE'")
    '        Fill_ComboFields(cmb_6_pipekind, "select t_values from tbl_setup where s_types = 'PIPE TYPE'")

    '        Fill_ComboFields(cmb_6_mainsize, "select t_values from tbl_setup where s_types = 'MAIN SIZE'")
    '        Fill_ComboFields(cmb_6_maintype, "select t_values from tbl_setup where s_types = 'MAIN TYPE'")
    '        Fill_ComboFields(cmb_6_testedwith, "select t_values from tbl_setup where s_types = 'TESTED WITH'")
    '        Fill_ComboFields(cmb_6_testedto, "select t_values from tbl_setup where s_types = 'TESTED TO'")
    '        Fill_ComboFields(cmb_6_city, "select t_values from tbl_setup where s_types = 'CITY'")

    '        Fill_ComboFields(cmb_6_add2, "select distinct   isnull(ADDR_PREFIX_1,' ') as t_values from address")
    '        Fill_ComboFields(cmb_6_add2_1, "select distinct  isnull(ADDR_PREFIX_2,' ') as t_values  from address")
    '        Fill_ComboFields(cmb_6_add4_1, "select distinct  isnull(ADDR_SUFFIX_CD,' ') as t_values  from address")
    '        Fill_ComboFields(cmb_6_add4, "select distinct  isnull(STREET_SUFFIX_CD,' ') as t_values  from address")

    '    ElseIf cmb_formtype.Text.Trim = "White" Then

    '        Fill_ComboFields(cmb_w_pipesize, "select t_values from tbl_setup where s_types = 'PIPE SIZE'")
    '        Fill_ComboFields(cmb_w_pipekind, "select t_values from tbl_setup where s_types = 'PIPE TYPE'")
    '        Fill_ComboFields(cmb_w_tapzize, "select t_values from tbl_setup where s_types = 'TAP SIZE'")
    '        Fill_ComboFields(cmb_w_mainsize, "select t_values from tbl_setup where s_types = 'MAIN SIZE'")
    '        Fill_ComboFields(cmb_w_maintype, "select t_values from tbl_setup where s_types = 'MAIN TYPE'")
    '        Fill_ComboFields(cmb_w_testedwith, "select t_values from tbl_setup where s_types = 'TESTED WITH'")
    '        Fill_ComboFields(cmb_w_testedto, "select t_values from tbl_setup where s_types = 'TESTED TO'")
    '        Fill_ComboFields(cmb_w_pressure, "select t_values from tbl_setup where s_types = 'PRESSURE'")
    '        Fill_ComboFields(cmb_w_add2, "select distinct   isnull(ADDR_PREFIX_1,' ') as t_values from address")
    '        Fill_ComboFields(cmb_w_add2_1, "select distinct  isnull(ADDR_PREFIX_2,' ') as t_values  from address")
    '        Fill_ComboFields(cmb_w_add4_1, "select distinct  isnull(ADDR_SUFFIX_CD,' ') as t_values  from address")
    '        Fill_ComboFields(cmb_w_add4, "select distinct  isnull(STREET_SUFFIX_CD,' ') as t_values  from address")
    '        Fill_ComboFields(cmb_w_city, "select t_values from tbl_setup where s_types = 'CITY'")
    '    ElseIf cmb_formtype.Text.Trim = "Orange" Then
    '        Fill_ComboFields(cmb_3_pipesize, "select t_values from tbl_setup where s_types = 'PIPE SIZE'")
    '        Fill_ComboFields(cmb_3_pipekind, "select t_values from tbl_setup where s_types = 'PIPE TYPE'")
    '        Fill_ComboFields(cmb_3_tapzize, "select t_values from tbl_setup where s_types = 'TAP SIZE'")
    '        Fill_ComboFields(cmb_3_mainsize, "select t_values from tbl_setup where s_types = 'MAIN SIZE'")
    '        Fill_ComboFields(cmb_3_maintype, "select t_values from tbl_setup where s_types = 'MAIN TYPE'")
    '        Fill_ComboFields(cmb_3_pressure, "select t_values from tbl_setup where s_types = 'PRESSURE'")
    '        Fill_ComboFields(cmb_3_add2, "select distinct   isnull(ADDR_PREFIX_1,' ') as t_values from address")
    '        Fill_ComboFields(cmb_3_add2_1, "select distinct  isnull(ADDR_PREFIX_2,' ') as t_values  from address")
    '        Fill_ComboFields(cmb_3_add4_1, "select distinct  isnull(ADDR_SUFFIX_CD,' ') as t_values  from address")
    '        Fill_ComboFields(cmb_3_add4, "select distinct  isnull(STREET_SUFFIX_CD,' ') as t_values  from address")
    '    ElseIf cmb_formtype.Text.Trim = "Form235-B-702" Then
    '        Fill_ComboFields(cmb_4_pipesize, "select t_values from tbl_setup where s_types = 'PIPE SIZE'")
    '        Fill_ComboFields(cmb_4_pipekind, "select t_values from tbl_setup where s_types = 'PIPE TYPE'")
    '        Fill_ComboFields(cmb_4_mainsize, "select t_values from tbl_setup where s_types = 'MAIN SIZE'")
    '        Fill_ComboFields(cmb_4_maintype, "select t_values from tbl_setup where s_types = 'MAIN TYPE'")
    '        Fill_ComboFields(cmb_4_testedwith, "select t_values from tbl_setup where s_types = 'TESTED WITH'")
    '        Fill_ComboFields(cmb_4_testedto, "select t_values from tbl_setup where s_types = 'TESTED TO'")
    '        Fill_ComboFields(cmb_4_city, "select t_values from tbl_setup where s_types = 'CITY'")
    '        Fill_ComboFields(cmb_4_pressure, "select t_values from tbl_setup where s_types = 'PRESSURE'")
    '        Fill_ComboFields(cmb_4_add2, "select distinct   isnull(ADDR_PREFIX_1,' ') as t_values from address")
    '        Fill_ComboFields(cmb_4_add2_1, "select distinct  isnull(ADDR_PREFIX_2,' ') as t_values  from address")
    '        Fill_ComboFields(cmb_4_add4_1, "select distinct  isnull(ADDR_SUFFIX_CD,' ') as t_values  from address")
    '        Fill_ComboFields(cmb_4_add4, "select distinct  isnull(STREET_SUFFIX_CD,' ') as t_values  from address")
    '    ElseIf cmb_formtype.Text.Trim = "OD-9-6-38" Then
    '        Fill_ComboFields(cmb_5_pipesize, "select t_values from tbl_setup where s_types = 'PIPE SIZE'")
    '        Fill_ComboFields(cmb_5_pipekind, "select t_values from tbl_setup where s_types = 'PIPE TYPE'")
    '        Fill_ComboFields(cmb_5_city, "select t_values from tbl_setup where s_types = 'CITY'")
    '        Fill_ComboFields(cmb_5_add2, "select distinct   isnull(ADDR_PREFIX_1,' ') as t_values from address")
    '        Fill_ComboFields(cmb_5_add2_1, "select distinct  isnull(ADDR_PREFIX_2,' ') as t_values  from address")
    '        Fill_ComboFields(cmb_5_add4_1, "select distinct  isnull(ADDR_SUFFIX_CD,' ') as t_values  from address")
    '        Fill_ComboFields(cmb_5_add4, "select distinct  isnull(STREET_SUFFIX_CD,' ') as t_values  from address")
    '    End If
    'End Sub
    Private Sub Fill_All_ComboBoxes()
        'Combo Fill FORM-100BLK
        If cmb_formtype.Text.Trim = "FORM-100BLK" Then
            If cmb_100b_add2.Items.Count = 0 Then
                'Fill_ComboFields(cmb_100b_add3, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_100b_add2, "SO_FrmQaADDR_PREFIX_1")
                Fill_ComboFields(cmb_100b_add2_1, "SO_FrmQaADDR_PREFIX_2")
                Fill_ComboFields(cmb_100b_add4_1, "SO_FrmQaADDR_SUFFIX_CD")
                Fill_ComboFields(cmb_100b_add4, "SO_FrmQaSTREET_SUFFIX_CD")
                Fill_ComboFields(cmb_100b_city, "SO_frmQaGetcombovalue")

                Fill_ComboFields(cmb_100b_pipesize, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_100b_pipekind, "SO_frmQaGetcombovalue")

                Fill_ComboFields(cmb_100b_tapsize, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_100b_pressure, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_100b_testedto, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_100b_testedwith, "SO_frmQaGetcombovalue")

                Fill_ComboFields(cmb_100b_mainsize, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_100b_maintype, "SO_frmQaGetcombovalue")
            End If

            'Combo Fill FORM-100BLK-MISC
        ElseIf cmb_formtype.Text.Trim = "FORM-100BLK-MISC" Then
            If cmb_100b_m_add2.Items.Count = 0 Then
                'Fill_ComboFields(cmb_100b_m_add3, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_100b_m_add2, "SO_FrmQaADDR_PREFIX_1")
                Fill_ComboFields(cmb_100b_m_add2_1, "SO_FrmQaADDR_PREFIX_2")
                Fill_ComboFields(cmb_100b_m_add4_1, "SO_FrmQaADDR_SUFFIX_CD")
                Fill_ComboFields(cmb_100b_m_add4, "SO_FrmQaSTREET_SUFFIX_CD")
                Fill_ComboFields(cmb_100b_m_city, "SO_frmQaGetcombovalue")

                Fill_ComboFields(cmb_100b_m_pipesize, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_100b_m_pipekind, "SO_frmQaGetcombovalue")

                Fill_ComboFields(cmb_100b_m_tapsize, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_100b_m_pressure, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_100b_m_testedto, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_100b_m_testedwith, "SO_frmQaGetcombovalue")

                Fill_ComboFields(cmb_100b_m_mainsize, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_100b_m_maintype, "SO_frmQaGetcombovalue")
            End If
        ElseIf cmb_formtype.Text.Trim = "FORM-200BLK" Then
            If cmbPrefix11.Items.Count = 0 Then
                Fill_ComboFields(cmb_typeofservice, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_pipe_size, "SO_frmQaGetcombovalue")
                'Fill_ComboFields(cmbDepthMain, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_main_type, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_main_size, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmbTapSize, "SO_frmQaGetcombovalue")
                '' '' ''Fill_ComboFields(cmbRetiredSize1, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmbMedium, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmbPressure, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_200b_city, "SO_frmQaGetcombovalue")
                ''Fill_ComboFields(cmbAppliancesUse, "SO_frmQaGetcombovalue")
                ''Fill_ComboFields(cmbTapLocation, "SO_frmQaGetcombovalue")
                ''Fill_ComboFields(cmbDepthMain, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmbRetiredSize, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmbPrefix11, "SO_FrmQaADDR_PREFIX_1")
                Fill_ComboFields(cmbPrefix22, "SO_FrmQaADDR_PREFIX_2")
                Fill_ComboFields(cmbsuffix12, "SO_FrmQaADDR_SUFFIX_CD")
                Fill_ComboFields(cmbsuffix22, "SO_FrmQaSTREET_SUFFIX_CD")
            End If

        ElseIf cmb_formtype.Text.Trim = "Yellow" Then
            If cmb_y_add2.Items.Count = 0 Then
                Fill_ComboFields(cmb_y_pipesize, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_y_pipekind, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_y_tapzize, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_y_mainsize, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_y_maintype, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_y_testedwith, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_y_testedto, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_y_city, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_y_pressure, "SO_frmQaGetcombovalue")

                Fill_ComboFields(cmb_y_add2, "SO_FrmQaADDR_PREFIX_1")
                Fill_ComboFields(cmb_y_add2_1, "SO_FrmQaADDR_PREFIX_2")
                Fill_ComboFields(cmb_y_add4_1, "SO_FrmQaADDR_SUFFIX_CD")
                Fill_ComboFields(cmb_y_add4, "SO_FrmQaSTREET_SUFFIX_CD")


                'Fill_ComboFields(cmb_y_pipesize, "select t_values from tbl_setup where s_types = 'PIPE SIZE'")
                ' Fill_ComboFields(cmb_y_pipekind, "select t_values from tbl_setup where s_types = 'PIPE TYPE'")
                'Fill_ComboFields(cmb_y_tapzize, "select t_values from tbl_setup where s_types = 'TAP SIZE'")
                'Fill_ComboFields(cmb_y_mainsize, "select t_values from tbl_setup where s_types = 'MAIN SIZE'")
                'Fill_ComboFields(cmb_y_maintype, "select t_values from tbl_setup where s_types = 'MAIN TYPE'")
                'Fill_ComboFields(cmb_y_testedwith, "select t_values from tbl_setup where s_types = 'TESTED WITH'")
                'Fill_ComboFields(cmb_y_testedto, "select t_values from tbl_setup where s_types = 'TESTED TO'")
                'Fill_ComboFields(cmb_y_city, "select t_values from tbl_setup where s_types = 'CITY'")
                'Fill_ComboFields(cmb_y_pressure, "select t_values from tbl_setup where s_types = 'PRESSURE'")

                'Fill_ComboFields(cmb_y_add2, "select distinct   isnull(ADDR_PREFIX_1,' ') as t_values from address")
                'Fill_ComboFields(cmb_y_add2_1, "select distinct  isnull(ADDR_PREFIX_2,' ') as t_values  from address")
                'Fill_ComboFields(cmb_y_add4_1, "select distinct  isnull(ADDR_SUFFIX_CD,' ') as t_values  from address")
                'Fill_ComboFields(cmb_y_add4, "select distinct  isnull(STREET_SUFFIX_CD,' ') as t_values  from address")



            End If



        ElseIf cmb_formtype.Text.Trim = "MISC" Then


            If cmb_l_add2.Items.Count = 0 Then
                Fill_ComboFields(cmb_l_city, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_l_misCtype, "SO_frmQaGetcombovalue")
                'Fill_ComboFields(cmb_l_city, "select t_values from tbl_setup where s_types = 'CITY'")
                Fill_ComboFields(cmb_l_add2, "SO_FrmQaADDR_PREFIX_1")
                Fill_ComboFields(cmb_l_add2_1, "SO_FrmQaADDR_PREFIX_2")
                Fill_ComboFields(cmb_l_add4_1, "SO_FrmQaADDR_SUFFIX_CD")
                Fill_ComboFields(cmb_l_add4, "SO_FrmQaSTREET_SUFFIX_CD")

                'Fill_ComboFields(cmb_l_add2, "select distinct   isnull(ADDR_PREFIX_1,' ') as t_values from address")
                'Fill_ComboFields(cmb_l_add2_1, "select distinct  isnull(ADDR_PREFIX_2,' ') as t_values  from address")
                'Fill_ComboFields(cmb_l_add4_1, "select distinct  isnull(ADDR_SUFFIX_CD,' ') as t_values  from address")
                'Fill_ComboFields(cmb_l_add4, "select distinct  isnull(STREET_SUFFIX_CD,' ') as t_values  from address")
                'Fill_ComboFields(cmb_l_misCtype, "select t_values from tbl_setup where s_types = 'Misc_Card_Type'")
            End If






        ElseIf cmb_formtype.Text.Trim = "ORIGINAL" Then

            If cmb_q_add2.Items.Count = 0 Then
                Fill_ComboFields(cmb_q_pipesize, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_q_pipekind, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_y_tapzize, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_q_mainsize, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_q_maintype, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_q_testedwith, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_q_testedto, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_q_city, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_q_coating, "SO_frmQaGetcombovalue")

                'Fill_ComboFields(cmb_q_pipesize, "select t_values from tbl_setup where s_types = 'PIPE SIZE'")
                'Fill_ComboFields(cmb_q_pipekind, "select t_values from tbl_setup where s_types = 'PIPE TYPE'")

                'Fill_ComboFields(cmb_q_mainsize, "select t_values from tbl_setup where s_types = 'MAIN SIZE'")
                'Fill_ComboFields(cmb_q_maintype, "select t_values from tbl_setup where s_types = 'MAIN TYPE'")
                'Fill_ComboFields(cmb_q_testedwith, "select t_values from tbl_setup where s_types = 'TESTED WITH'")
                'Fill_ComboFields(cmb_q_testedto, "select t_values from tbl_setup where s_types = 'TESTED TO'")
                'Fill_ComboFields(cmb_q_city, "select t_values from tbl_setup where s_types = 'CITY'")
                Fill_ComboFields(cmb_q_add2, "SO_FrmQaADDR_PREFIX_1")
                Fill_ComboFields(cmb_q_add2_1, "SO_FrmQaADDR_PREFIX_2")
                Fill_ComboFields(cmb_q_add4_1, "SO_FrmQaADDR_SUFFIX_CD")
                Fill_ComboFields(cmb_q_add4, "SO_FrmQaSTREET_SUFFIX_CD")


                'Fill_ComboFields(cmb_q_add2, "select distinct   isnull(ADDR_PREFIX_1,' ') as t_values from address")
                'Fill_ComboFields(cmb_q_add2_1, "select distinct  isnull(ADDR_PREFIX_2,' ') as t_values  from address")
                'Fill_ComboFields(cmb_q_add4_1, "select distinct  isnull(ADDR_SUFFIX_CD,' ') as t_values  from address")
                'Fill_ComboFields(cmb_q_add4, "select distinct  isnull(STREET_SUFFIX_CD,' ') as t_values  from address")


                'Fill_ComboFields(cmb_q_coating, "select t_values from tbl_setup where s_types = 'Type_of_coating'")
            End If



        ElseIf cmb_formtype.Text.Trim = "ORIGINAL-R" Then

            If cmb_r_add2.Items.Count = 0 Then
                Fill_ComboFields(cmb_r_pipesize, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_r_pipekind, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_r_mainsize, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_r_maintype, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_r_testedwith, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_r_testedto, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_r_city, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_r_connection_data, "SO_frmQaGetcombovalue")



                'Fill_ComboFields(cmb_r_pipesize, "select t_values from tbl_setup where s_types = 'PIPE SIZE'")
                'Fill_ComboFields(cmb_r_pipekind, "select t_values from tbl_setup where s_types = 'PIPE TYPE'")

                'Fill_ComboFields(cmb_r_mainsize, "select t_values from tbl_setup where s_types = 'MAIN SIZE'")
                'Fill_ComboFields(cmb_r_maintype, "select t_values from tbl_setup where s_types = 'MAIN TYPE'")
                'Fill_ComboFields(cmb_r_testedwith, "select t_values from tbl_setup where s_types = 'TESTED WITH'")
                'Fill_ComboFields(cmb_r_testedto, "select t_values from tbl_setup where s_types = 'TESTED TO'")
                'Fill_ComboFields(cmb_r_city, "select t_values from tbl_setup where s_types = 'CITY'")
                Fill_ComboFields(cmb_r_add2, "SO_FrmQaADDR_PREFIX_1")
                Fill_ComboFields(cmb_r_add2_1, "SO_FrmQaADDR_PREFIX_2")
                Fill_ComboFields(cmb_r_add4_1, "SO_FrmQaADDR_SUFFIX_CD")
                Fill_ComboFields(cmb_r_add4, "SO_FrmQaSTREET_SUFFIX_CD")

                'Fill_ComboFields(cmb_r_add2, "select distinct   isnull(ADDR_PREFIX_1,' ') as t_values from address")
                'Fill_ComboFields(cmb_r_add2_1, "select distinct  isnull(ADDR_PREFIX_2,' ') as t_values  from address")
                'Fill_ComboFields(cmb_r_add4_1, "select distinct  isnull(ADDR_SUFFIX_CD,' ') as t_values  from address")
                'Fill_ComboFields(cmb_r_add4, "select distinct  isnull(STREET_SUFFIX_CD,' ') as t_values  from address")


                'Fill_ComboFields(cmb_r_connection_data, "select t_values from tbl_setup where s_types = 'connection_data'")
            End If


        ElseIf cmb_formtype.Text.Trim = "ABANDON-II" Then
            If cmb_a_add2.Items.Count = 0 Then

                Fill_ComboFields(cmb_a_mainsize, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_a_maintype, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_a_testedwith, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_a_city, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_a_reasonabandon, "SO_frmQaGetcombovalue")


                'Fill_ComboFields(cmb_a_mainsize, "select t_values from tbl_setup where s_types = 'MAIN SIZE'")
                'Fill_ComboFields(cmb_a_maintype, "select t_values from tbl_setup where s_types = 'MAIN TYPE'")
                'Fill_ComboFields(cmb_a_testedwith, "select t_values from tbl_setup where s_types = 'TESTED WITH'")

                'Fill_ComboFields(cmb_a_city, "select t_values from tbl_setup where s_types = 'CITY'")
                Fill_ComboFields(cmb_a_add2, "SO_FrmQaADDR_PREFIX_1")
                Fill_ComboFields(cmb_a_add2_1, "SO_FrmQaADDR_PREFIX_2")
                Fill_ComboFields(cmb_a_add4_1, "SO_FrmQaADDR_SUFFIX_CD")
                Fill_ComboFields(cmb_a_add4, "SO_FrmQaSTREET_SUFFIX_CD")

                'Fill_ComboFields(cmb_a_add2, "select distinct   isnull(ADDR_PREFIX_1,' ') as t_values from address")
                'Fill_ComboFields(cmb_a_add2_1, "select distinct  isnull(ADDR_PREFIX_2,' ') as t_values  from address")
                'Fill_ComboFields(cmb_a_add4_1, "select distinct  isnull(ADDR_SUFFIX_CD,' ') as t_values  from address")
                'Fill_ComboFields(cmb_a_add4, "select distinct  isnull(STREET_SUFFIX_CD,' ') as t_values  from address")
                'Fill_ComboFields(cmb_a_reasonabandon, "select t_values from tbl_setup where s_types = 'Reason_of_abandon'")

            End If


        ElseIf cmb_formtype.Text.Trim = "Form-X" Then
            If cmb_x_add2.Items.Count = 0 Then

                Fill_ComboFields(cmb_x_pipesize, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_x_pipekind, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_x_mainsize, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_x_maintype, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_x_testedwith, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_x_testedto, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_x_city, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_x_coating, "SO_frmQaGetcombovalue")





                'Fill_ComboFields(cmb_x_pipesize, "select t_values from tbl_setup where s_types = 'PIPE SIZE'")
                'Fill_ComboFields(cmb_x_pipekind, "select t_values from tbl_setup where s_types = 'PIPE TYPE'")

                'Fill_ComboFields(cmb_x_mainsize, "select t_values from tbl_setup where s_types = 'MAIN SIZE'")
                'Fill_ComboFields(cmb_x_maintype, "select t_values from tbl_setup where s_types = 'MAIN TYPE'")
                'Fill_ComboFields(cmb_x_testedwith, "select t_values from tbl_setup where s_types = 'TESTED WITH'")
                'Fill_ComboFields(cmb_x_testedto, "select t_values from tbl_setup where s_types = 'TESTED TO'")
                'Fill_ComboFields(cmb_x_city, "select t_values from tbl_setup where s_types = 'CITY'")
                Fill_ComboFields(cmb_x_add2, "SO_FrmQaADDR_PREFIX_1")
                Fill_ComboFields(cmb_x_add2_1, "SO_FrmQaADDR_PREFIX_2")
                Fill_ComboFields(cmb_x_add4_1, "SO_FrmQaADDR_SUFFIX_CD")
                Fill_ComboFields(cmb_x_add4, "SO_FrmQaSTREET_SUFFIX_CD")
                'Fill_ComboFields(cmb_x_add2, "select distinct   isnull(ADDR_PREFIX_1,' ') as t_values from address")
                'Fill_ComboFields(cmb_x_add2_1, "select distinct  isnull(ADDR_PREFIX_2,' ') as t_values  from address")
                'Fill_ComboFields(cmb_x_add4_1, "select distinct  isnull(ADDR_SUFFIX_CD,' ') as t_values  from address")
                'Fill_ComboFields(cmb_x_add4, "select distinct  isnull(STREET_SUFFIX_CD,' ') as t_values  from address")
                'Fill_ComboFields(cmb_x_coating, "select t_values from tbl_setup where s_types = 'Type_of_coating'")
            End If


        ElseIf cmb_formtype.Text.Trim = "FORM-IX" Then
            If cmb_9_add2.Items.Count = 0 Then
                Fill_ComboFields(cmb_9_pipesize, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_9_pipekind, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_9_tapzize, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_9_mainsize, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_9_maintype, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_9_city, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_9_coating, "SO_frmQaGetcombovalue")



                'Fill_ComboFields(cmb_9_pipesize, "select t_values from tbl_setup where s_types = 'PIPE SIZE'")
                'Fill_ComboFields(cmb_9_pipekind, "select t_values from tbl_setup where s_types = 'PIPE TYPE'")
                'Fill_ComboFields(cmb_9_tapzize, "select t_values from tbl_setup where s_types = 'TAP SIZE'")
                'Fill_ComboFields(cmb_9_mainsize, "select t_values from tbl_setup where s_types = 'MAIN SIZE'")
                'Fill_ComboFields(cmb_9_maintype, "select t_values from tbl_setup where s_types = 'MAIN TYPE'")
                'Fill_ComboFields(cmb_9_city, "select t_values from tbl_setup where s_types = 'CITY'")
                Fill_ComboFields(cmb_9_add2, "SO_FrmQaADDR_PREFIX_1")
                Fill_ComboFields(cmb_9_add2_1, "SO_FrmQaADDR_PREFIX_2")
                Fill_ComboFields(cmb_9_add4_1, "SO_FrmQaADDR_SUFFIX_CD")
                Fill_ComboFields(cmb_9_add4, "SO_FrmQaSTREET_SUFFIX_CD")

                'Fill_ComboFields(cmb_9_add2, "select distinct   isnull(ADDR_PREFIX_1,' ') as t_values from address")
                'Fill_ComboFields(cmb_9_add2_1, "select distinct  isnull(ADDR_PREFIX_2,' ') as t_values  from address")
                'Fill_ComboFields(cmb_9_add4_1, "select distinct  isnull(ADDR_SUFFIX_CD,' ') as t_values  from address")
                'Fill_ComboFields(cmb_9_add4, "select distinct  isnull(STREET_SUFFIX_CD,' ') as t_values  from address")
                'Fill_ComboFields(cmb_9_coating, "select t_values from tbl_setup where s_types = 'Type_of_coating'")
            End If

        ElseIf cmb_formtype.Text.Trim = "ABANDON-I" Then
            If cmb_8_add2.Items.Count = 0 Then

                Fill_ComboFields(cmb_8_mainsize, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_8_maintype, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_8_city, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_8_coating, "SO_frmQaGetcombovalue")

                'Fill_ComboFields(cmb_8_mainsize, "select t_values from tbl_setup where s_types = 'MAIN SIZE'")
                'Fill_ComboFields(cmb_8_maintype, "select t_values from tbl_setup where s_types = 'MAIN TYPE'")
                'Fill_ComboFields(cmb_8_city, "select t_values from tbl_setup where s_types = 'CITY'")
                Fill_ComboFields(cmb_8_add2, "SO_FrmQaADDR_PREFIX_1")
                Fill_ComboFields(cmb_8_add2_1, "SO_FrmQaADDR_PREFIX_2")
                Fill_ComboFields(cmb_8_add4_1, "SO_FrmQaADDR_SUFFIX_CD")
                Fill_ComboFields(cmb_8_add4, "SO_FrmQaSTREET_SUFFIX_CD")



                'Fill_ComboFields(cmb_8_add2, "select distinct   isnull(ADDR_PREFIX_1,' ') as t_values from address")
                'Fill_ComboFields(cmb_8_add2_1, "select distinct  isnull(ADDR_PREFIX_2,' ') as t_values  from address")
                'Fill_ComboFields(cmb_8_add4_1, "select distinct  isnull(ADDR_SUFFIX_CD,' ') as t_values  from address")
                'Fill_ComboFields(cmb_8_add4, "select distinct  isnull(STREET_SUFFIX_CD,' ') as t_values  from address")
                'Fill_ComboFields(cmb_8_coating, "select t_values from tbl_setup where s_types = 'Type_of_coating'")
            End If

        ElseIf cmb_formtype.Text.Trim = "Form-954" Then
            If cmb_7_add2.Items.Count = 0 Then

                Fill_ComboFields(cmb_7_pipesize, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_7_pipekind, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_7_tapzize, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_7_mainsize, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_7_maintype, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_7_city, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_7_coating, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_7_naturework, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_7_kindjoint, "SO_frmQaGetcombovalue")

                'Fill_ComboFields(cmb_7_pipesize, "select t_values from tbl_setup where s_types = 'PIPE SIZE'")
                'Fill_ComboFields(cmb_7_pipekind, "select t_values from tbl_setup where s_types = 'PIPE TYPE'")
                'Fill_ComboFields(cmb_7_tapzize, "select t_values from tbl_setup where s_types = 'TAP SIZE'")
                'Fill_ComboFields(cmb_7_mainsize, "select t_values from tbl_setup where s_types = 'MAIN SIZE'")
                'Fill_ComboFields(cmb_7_maintype, "select t_values from tbl_setup where s_types = 'MAIN TYPE'")
                'Fill_ComboFields(cmb_7_city, "select t_values from tbl_setup where s_types = 'CITY'")
                Fill_ComboFields(cmb_7_add2, "SO_FrmQaADDR_PREFIX_1")
                Fill_ComboFields(cmb_7_add2_1, "SO_FrmQaADDR_PREFIX_2")
                Fill_ComboFields(cmb_7_add4_1, "SO_FrmQaADDR_SUFFIX_CD")
                Fill_ComboFields(cmb_7_add4, "SO_FrmQaSTREET_SUFFIX_CD")



                'Fill_ComboFields(cmb_7_add2, "select distinct   isnull(ADDR_PREFIX_1,' ') as t_values from address")
                'Fill_ComboFields(cmb_7_add2_1, "select distinct  isnull(ADDR_PREFIX_2,' ') as t_values  from address")
                'Fill_ComboFields(cmb_7_add4_1, "select distinct  isnull(ADDR_SUFFIX_CD,' ') as t_values  from address")
                'Fill_ComboFields(cmb_7_add4, "select distinct  isnull(STREET_SUFFIX_CD,' ') as t_values  from address")
                'Fill_ComboFields(cmb_7_naturework, "select t_values from tbl_setup where s_types = 'Nature_of_work'")
                'Fill_ComboFields(cmb_7_kindjoint, "select t_values from tbl_setup where s_types = 'Kind_of_joint'")
                'Fill_ComboFields(cmb_7_coating, "select t_values from tbl_setup where s_types = 'Type_of_coating'")
            End If

        ElseIf cmb_formtype.Text.Trim = "Form-80I" Then
            If cmb_6_add2.Items.Count = 0 Then
                Fill_ComboFields(cmb_6_pipesize, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_6_pipekind, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_6_mainsize, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_6_maintype, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_6_testedwith, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_6_testedto, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_6_city, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_6_add2, "SO_FrmQaADDR_PREFIX_1")
                Fill_ComboFields(cmb_6_add2_1, "SO_FrmQaADDR_PREFIX_2")
                Fill_ComboFields(cmb_6_add4_1, "SO_FrmQaADDR_SUFFIX_CD")
                Fill_ComboFields(cmb_6_add4, "SO_FrmQaSTREET_SUFFIX_CD")


                'Fill_ComboFields(cmb_6_pipesize, "select t_values from tbl_setup where s_types = 'PIPE SIZE'")
                'Fill_ComboFields(cmb_6_pipekind, "select t_values from tbl_setup where s_types = 'PIPE TYPE'")

                'Fill_ComboFields(cmb_6_mainsize, "select t_values from tbl_setup where s_types = 'MAIN SIZE'")
                'Fill_ComboFields(cmb_6_maintype, "select t_values from tbl_setup where s_types = 'MAIN TYPE'")
                'Fill_ComboFields(cmb_6_testedwith, "select t_values from tbl_setup where s_types = 'TESTED WITH'")
                'Fill_ComboFields(cmb_6_testedto, "select t_values from tbl_setup where s_types = 'TESTED TO'")
                'Fill_ComboFields(cmb_6_city, "select t_values from tbl_setup where s_types = 'CITY'")

                'Fill_ComboFields(cmb_6_add2, "select distinct   isnull(ADDR_PREFIX_1,' ') as t_values from address")
                'Fill_ComboFields(cmb_6_add2_1, "select distinct  isnull(ADDR_PREFIX_2,' ') as t_values  from address")
                'Fill_ComboFields(cmb_6_add4_1, "select distinct  isnull(ADDR_SUFFIX_CD,' ') as t_values  from address")
                'Fill_ComboFields(cmb_6_add4, "select distinct  isnull(STREET_SUFFIX_CD,' ') as t_values  from address")
            End If


        ElseIf cmb_formtype.Text.Trim = "White" Then
            If cmb_w_add2.Items.Count = 0 Then

                Fill_ComboFields(cmb_w_pipesize, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_w_pipekind, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_w_tapzize, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_w_mainsize, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_w_maintype, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_w_testedwith, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_w_testedto, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_w_pressure, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_w_city, "SO_frmQaGetcombovalue")


                'Fill_ComboFields(cmb_w_pipesize, "select t_values from tbl_setup where s_types = 'PIPE SIZE'")
                'Fill_ComboFields(cmb_w_pipekind, "select t_values from tbl_setup where s_types = 'PIPE TYPE'")
                'Fill_ComboFields(cmb_w_tapzize, "select t_values from tbl_setup where s_types = 'TAP SIZE'")
                'Fill_ComboFields(cmb_w_mainsize, "select t_values from tbl_setup where s_types = 'MAIN SIZE'")
                'Fill_ComboFields(cmb_w_maintype, "select t_values from tbl_setup where s_types = 'MAIN TYPE'")
                'Fill_ComboFields(cmb_w_testedwith, "select t_values from tbl_setup where s_types = 'TESTED WITH'")
                'Fill_ComboFields(cmb_w_testedto, "select t_values from tbl_setup where s_types = 'TESTED TO'")
                'Fill_ComboFields(cmb_w_pressure, "select t_values from tbl_setup where s_types = 'PRESSURE'")
                Fill_ComboFields(cmb_w_add2, "SO_FrmQaADDR_PREFIX_1")
                Fill_ComboFields(cmb_w_add2_1, "SO_FrmQaADDR_PREFIX_2")
                Fill_ComboFields(cmb_w_add4_1, "SO_FrmQaADDR_SUFFIX_CD")
                Fill_ComboFields(cmb_w_add4, "SO_FrmQaSTREET_SUFFIX_CD")



                'Fill_ComboFields(cmb_w_add2, "select distinct   isnull(ADDR_PREFIX_1,' ') as t_values from address")
                'Fill_ComboFields(cmb_w_add2_1, "select distinct  isnull(ADDR_PREFIX_2,' ') as t_values  from address")
                'Fill_ComboFields(cmb_w_add4_1, "select distinct  isnull(ADDR_SUFFIX_CD,' ') as t_values  from address")
                'Fill_ComboFields(cmb_w_add4, "select distinct  isnull(STREET_SUFFIX_CD,' ') as t_values  from address")
                'Fill_ComboFields(cmb_w_city, "select t_values from tbl_setup where s_types = 'CITY'")
            End If

        ElseIf cmb_formtype.Text.Trim = "Orange" Then
            If cmb_3_add2.Items.Count = 0 Then

                Fill_ComboFields(cmb_3_pipesize, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_3_pipekind, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_3_tapzize, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_3_mainsize, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_3_maintype, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_3_pressure, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_3_city, "SO_frmQaGetcombovalue")





                'Fill_ComboFields(cmb_3_pipesize, "select t_values from tbl_setup where s_types = 'PIPE SIZE'")
                'Fill_ComboFields(cmb_3_pipekind, "select t_values from tbl_setup where s_types = 'PIPE TYPE'")
                'Fill_ComboFields(cmb_3_tapzize, "select t_values from tbl_setup where s_types = 'TAP SIZE'")
                'Fill_ComboFields(cmb_3_mainsize, "select t_values from tbl_setup where s_types = 'MAIN SIZE'")
                'Fill_ComboFields(cmb_3_maintype, "select t_values from tbl_setup where s_types = 'MAIN TYPE'")
                'Fill_ComboFields(cmb_3_pressure, "select t_values from tbl_setup where s_types = 'PRESSURE'")
                'Fill_ComboFields(cmb_3_city, "select t_values from tbl_setup where s_types = 'CITY'")
                Fill_ComboFields(cmb_3_add2, "SO_FrmQaADDR_PREFIX_1")
                Fill_ComboFields(cmb_3_add2_1, "SO_FrmQaADDR_PREFIX_2")
                Fill_ComboFields(cmb_3_add4_1, "SO_FrmQaADDR_SUFFIX_CD")
                Fill_ComboFields(cmb_3_add4, "SO_FrmQaSTREET_SUFFIX_CD")


                'Fill_ComboFields(cmb_3_add2, "select distinct   isnull(ADDR_PREFIX_1,' ') as t_values from address")
                'Fill_ComboFields(cmb_3_add2_1, "select distinct  isnull(ADDR_PREFIX_2,' ') as t_values  from address")
                'Fill_ComboFields(cmb_3_add4_1, "select distinct  isnull(ADDR_SUFFIX_CD,' ') as t_values  from address")
                'Fill_ComboFields(cmb_3_add4, "select distinct  isnull(STREET_SUFFIX_CD,' ') as t_values  from address")
            End If

        ElseIf cmb_formtype.Text.Trim = "Form235-B-702" Then
            If cmb_4_add2.Items.Count = 0 Then

                Fill_ComboFields(cmb_4_pipesize, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_4_pipekind, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_4_mainsize, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_4_maintype, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_4_testedwith, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_4_testedto, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_4_city, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_4_pressure, "SO_frmQaGetcombovalue")

                'Fill_ComboFields(cmb_4_pipesize, "select t_values from tbl_setup where s_types = 'PIPE SIZE'")
                'Fill_ComboFields(cmb_4_pipekind, "select t_values from tbl_setup where s_types = 'PIPE TYPE'")
                'Fill_ComboFields(cmb_4_mainsize, "select t_values from tbl_setup where s_types = 'MAIN SIZE'")
                'Fill_ComboFields(cmb_4_maintype, "select t_values from tbl_setup where s_types = 'MAIN TYPE'")
                'Fill_ComboFields(cmb_4_testedwith, "select t_values from tbl_setup where s_types = 'TESTED WITH'")
                'Fill_ComboFields(cmb_4_testedto, "select t_values from tbl_setup where s_types = 'TESTED TO'")
                'Fill_ComboFields(cmb_4_city, "select t_values from tbl_setup where s_types = 'CITY'")
                'Fill_ComboFields(cmb_4_pressure, "select t_values from tbl_setup where s_types = 'PRESSURE'")
                Fill_ComboFields(cmb_4_add2, "SO_FrmQaADDR_PREFIX_1")
                Fill_ComboFields(cmb_4_add2_1, "SO_FrmQaADDR_PREFIX_2")
                Fill_ComboFields(cmb_4_add4_1, "SO_FrmQaADDR_SUFFIX_CD")
                Fill_ComboFields(cmb_4_add4, "SO_FrmQaSTREET_SUFFIX_CD")



                'Fill_ComboFields(cmb_4_add2, "select distinct   isnull(ADDR_PREFIX_1,' ') as t_values from address")
                'Fill_ComboFields(cmb_4_add2_1, "select distinct  isnull(ADDR_PREFIX_2,' ') as t_values  from address")
                'Fill_ComboFields(cmb_4_add4_1, "select distinct  isnull(ADDR_SUFFIX_CD,' ') as t_values  from address")
                'Fill_ComboFields(cmb_4_add4, "select distinct  isnull(STREET_SUFFIX_CD,' ') as t_values  from address")
            End If

        ElseIf cmb_formtype.Text.Trim = "OD-9-6-38" Then
            If cmb_5_add2.Items.Count = 0 Then

                Fill_ComboFields(cmb_5_pipesize, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_5_pipekind, "SO_frmQaGetcombovalue")
                Fill_ComboFields(cmb_5_city, "SO_frmQaGetcombovalue")

                'Fill_ComboFields(cmb_5_pipesize, "select t_values from tbl_setup where s_types = 'PIPE SIZE'")
                'Fill_ComboFields(cmb_5_pipekind, "select t_values from tbl_setup where s_types = 'PIPE TYPE'")
                'Fill_ComboFields(cmb_5_city, "select t_values from tbl_setup where s_types = 'CITY'")
                Fill_ComboFields(cmb_5_add2, "SO_FrmQaADDR_PREFIX_1")
                Fill_ComboFields(cmb_5_add2_1, "SO_FrmQaADDR_PREFIX_2")
                Fill_ComboFields(cmb_5_add4_1, "SO_FrmQaADDR_SUFFIX_CD")
                Fill_ComboFields(cmb_5_add4, "SO_FrmQaSTREET_SUFFIX_CD")



                'Fill_ComboFields(cmb_5_add2, "select distinct   isnull(ADDR_PREFIX_1,' ') as t_values from address")
                'Fill_ComboFields(cmb_5_add2_1, "select distinct  isnull(ADDR_PREFIX_2,' ') as t_values  from address")
                'Fill_ComboFields(cmb_5_add4_1, "select distinct  isnull(ADDR_SUFFIX_CD,' ') as t_values  from address")
                'Fill_ComboFields(cmb_5_add4, "select distinct  isnull(STREET_SUFFIX_CD,' ') as t_values  from address")
            End If

        End If
    End Sub
    Private Sub Fill_ComboFields(ByVal comboField As ComboBox, ByVal cmdText As String)
        'comboField.Items.Clear()
        cmd = Nothing
        Try

            cmd = New SqlCommand(cmdText, conn1)
            cmd.CommandType = CommandType.StoredProcedure
            If cmdText = "SO_frmQaGetcombovalue" Then
                If comboField.Name = "cmb_100b_m_pipesize" Or comboField.Name = "cmb_100b_pipesize" Or comboField.Name = "cmb_pipe_size" Or comboField.Name = "cmb_y_pipesize" Or comboField.Name = "cmb_q_pipesize" Or comboField.Name = "cmb_5_pipesize" Or comboField.Name = "cmb_4_pipesize" Or comboField.Name = "cmb_3_pipesize" Or comboField.Name = "cmb_w_pipesize" Or comboField.Name = "cmb_6_pipesize" Or comboField.Name = "cmb_7_pipesize" Or comboField.Name = "cmb_9_pipesize" Or comboField.Name = "cmb_x_pipesize" Or comboField.Name = "cmb_r_pipesize" Then
                    cmd.Parameters.AddWithValue("@stypes", "PIPE SIZE")
                End If
                If comboField.Name = "cmb_100b_m_pipekind" Or comboField.Name = "cmb_typeofservice" Or comboField.Name = "cmb_100b_pipekind" Or comboField.Name = "cmb_y_pipekind" Or comboField.Name = "cmb_q_pipekind" Or comboField.Name = "cmb_r_pipekind" Or comboField.Name = "cmb_x_pipekind" Or comboField.Name = "cmb_9_pipekind" Or comboField.Name = "cmb_7_pipekind" Or comboField.Name = "cmb_6_pipekind" Or comboField.Name = "cmb_w_pipekind" Or comboField.Name = "cmb_3_pipekind" Or comboField.Name = "cmb_4_pipekind" Or comboField.Name = "cmb_5_pipekind" Then
                    cmd.Parameters.AddWithValue("@stypes", "PIPE TYPE")
                End If
                If comboField.Name = "cmb_100b_m_tapsize" Or comboField.Name = "cmbTapSize" Or comboField.Name = "cmb_100b_tapsize" Or comboField.Name = "cmb_y_tapzize" Or comboField.Name = "cmb_9_tapzize" Or comboField.Name = "cmb_7_tapzize" Or comboField.Name = "cmb_w_tapzize" Or comboField.Name = "cmb_3_tapzize" Then
                    cmd.Parameters.AddWithValue("@stypes", "TAP SIZE")
                End If
                If comboField.Name = "cmb_100b_m_mainsize" Or comboField.Name = "cmb_main_size" Or comboField.Name = "cmbRetiredSize" Or comboField.Name = "cmb_100b_mainsize" Or comboField.Name = "cmb_y_mainsize" Or comboField.Name = "cmb_q_mainsize" Or comboField.Name = "cmb_r_mainsize" Or comboField.Name = "cmb_a_mainsize" Or comboField.Name = "cmb_x_mainsize" Or comboField.Name = "cmb_9_mainsize" Or comboField.Name = "cmb_8_mainsize" Or comboField.Name = "cmb_7_mainsize" Or comboField.Name = "cmb_6_mainsize" Or comboField.Name = "cmb_w_mainsize" Or comboField.Name = "cmb_3_mainsize" Or comboField.Name = "cmb_4_mainsize" Then
                    cmd.Parameters.AddWithValue("@stypes", "MAIN SIZE")
                End If
                If comboField.Name = "cmb_100b_m_maintype" Or comboField.Name = "cmb_main_type" Or comboField.Name = "cmb_100b_maintype" Or comboField.Name = "cmb_100b_maintype" Or comboField.Name = "cmb_y_maintype" Or comboField.Name = "cmb_q_maintype" Or comboField.Name = "cmb_r_maintype" Or comboField.Name = "cmb_a_maintype" Or comboField.Name = "cmb_x_maintype" Or comboField.Name = "cmb_9_maintype" Or comboField.Name = "cmb_8_maintype" Or comboField.Name = "cmb_7_maintype" Or comboField.Name = "cmb_6_maintype" Or comboField.Name = "cmb_w_maintype" Or comboField.Name = "cmb_3_maintype" Or comboField.Name = "cmb_4_maintype" Then
                    cmd.Parameters.AddWithValue("@stypes", "MAIN TYPE")
                End If
                If comboField.Name = "cmb_100b_m_testedwith" Or comboField.Name = "cmbMedium" Or comboField.Name = "cmb_100b_testedwith" Or comboField.Name = "cmb_y_testedwith" Or comboField.Name = "cmb_q_testedwith" Or comboField.Name = "cmb_r_testedwith" Or comboField.Name = "cmb_a_testedwith" Or comboField.Name = "cmb_x_testedwith" Or comboField.Name = "cmb_6_testedwith" Or comboField.Name = "cmb_w_testedwith" Or comboField.Name = "cmb_4_testedwith" Then
                    cmd.Parameters.AddWithValue("@stypes", "TESTED WITH")
                End If
                If comboField.Name = "cmb_100b_m_testedto" Or comboField.Name = "cmbPressure" Or comboField.Name = "cmb_100b_testedto" Or comboField.Name = "cmb_y_testedto" Or comboField.Name = "cmb_q_testedto" Or comboField.Name = "cmb_r_testedto" Or comboField.Name = "cmb_x_testedto" Or comboField.Name = "cmb_6_testedto" Or comboField.Name = "cmb_w_testedto" Or comboField.Name = "cmb_4_testedto" Then
                    cmd.Parameters.AddWithValue("@stypes", "TESTED TO")
                End If
                If comboField.Name = "cmb_100b_m_city" Or comboField.Name = "cmb_200b_city" Or comboField.Name = "cmb_100b_city" Or comboField.Name = "cmb_y_city" Or comboField.Name = "cmb_l_city" Or comboField.Name = "cmb_q_city" Or comboField.Name = "cmb_r_city" Or comboField.Name = "cmb_a_city" Or comboField.Name = "cmb_x_city" Or comboField.Name = "cmb_9_city" Or comboField.Name = "cmb_8_city" Or comboField.Name = "cmb_7_city" Or comboField.Name = "cmb_6_city" Or comboField.Name = "cmb_w_city" Or comboField.Name = "cmb_3_city" Or comboField.Name = "cmb_4_city" Or comboField.Name = "cmb_5_city" Then
                    cmd.Parameters.AddWithValue("@stypes", "CITY")
                End If
                If comboField.Name = "cmb_100b_m_pressure" Or comboField.Name = "cmb_100b_pressure" Or comboField.Name = "cmb_y_pressure" Or comboField.Name = "cmb_w_pressure" Or comboField.Name = "cmb_3_pressure" Or comboField.Name = "cmb_4_pressure" Then
                    cmd.Parameters.AddWithValue("@stypes", "PRESSURE")
                End If
                If comboField.Name = "cmb_q_coating" Or comboField.Name = "cmb_x_coating" Or comboField.Name = "cmb_9_coating" Or comboField.Name = "cmb_8_coating" Or comboField.Name = "cmb_7_coating" Then
                    cmd.Parameters.AddWithValue("@stypes", "Type_of_coating")
                End If
                If comboField.Name = "cmb_r_connection_data" Then
                    cmd.Parameters.AddWithValue("@stypes", "connection_data")
                End If
                If comboField.Name = "cmb_a_reasonabandon" Then
                    cmd.Parameters.AddWithValue("@stypes", "Reason_of_abandon")
                End If
                If comboField.Name = "cmb_l_misCtype" Then
                    cmd.Parameters.AddWithValue("@stypes", "Misc_Card_Type")
                End If
                If comboField.Name = "cmb_7_naturework" Then
                    cmd.Parameters.AddWithValue("@stypes", "Nature_of_work")
                End If
                If comboField.Name = "cmb_7_kindjoint" Then
                    cmd.Parameters.AddWithValue("@stypes", "Kind_of_joint")
                End If
            End If
            '    If comboField.Name = "cmb_y_pipesize" Or comboField.Name = "cmb_q_pipesize" Or comboField.Name = "cmb_5_pipesize" Or comboField.Name = "cmb_4_pipesize" Or comboField.Name = "cmb_3_pipesize" Or comboField.Name = "cmb_w_pipesize" Or comboField.Name = "cmb_6_pipesize" Or comboField.Name = "cmb_7_pipesize" Or comboField.Name = "cmb_9_pipesize" Or comboField.Name = "cmb_x_pipesize" Or comboField.Name = "cmb_r_pipesize" Then
            '        cmd.Parameters.AddWithValue("@stypes", "PIPE SIZE")
            '    End If
            '    If comboField.Name = "cmb_y_pipekind" Or comboField.Name = "cmb_q_pipekind" Or comboField.Name = "cmb_r_pipekind" Or comboField.Name = "cmb_x_pipekind" Or comboField.Name = "cmb_9_pipekind" Or comboField.Name = "cmb_7_pipekind" Or comboField.Name = "cmb_6_pipekind" Or comboField.Name = "cmb_w_pipekind" Or comboField.Name = "cmb_3_pipekind" Or comboField.Name = "cmb_4_pipekind" Or comboField.Name = "cmb_5_pipekind" Then
            '        cmd.Parameters.AddWithValue("@stypes", "PIPE TYPE")
            '    End If
            '    If comboField.Name = "cmb_y_tapzize" Or comboField.Name = "cmb_9_tapzize" Or comboField.Name = "cmb_7_tapzize" Or comboField.Name = "cmb_w_tapzize" Or comboField.Name = "cmb_3_tapzize" Then
            '        cmd.Parameters.AddWithValue("@stypes", "TAP SIZE")
            '    End If
            '    If comboField.Name = "cmb_y_mainsize" Or comboField.Name = "cmb_q_mainsize" Or comboField.Name = "cmb_r_mainsize" Or comboField.Name = "cmb_a_mainsize" Or comboField.Name = "cmb_x_mainsize" Or comboField.Name = "cmb_9_mainsize" Or comboField.Name = "cmb_8_mainsize" Or comboField.Name = "cmb_7_mainsize" Or comboField.Name = "cmb_6_mainsize" Or comboField.Name = "cmb_w_mainsize" Or comboField.Name = "cmb_3_mainsize" Or comboField.Name = "cmb_4_mainsize" Then
            '        cmd.Parameters.AddWithValue("@stypes", "MAIN SIZE")
            '    End If
            '    If comboField.Name = "cmb_y_maintype" Or comboField.Name = "cmb_q_maintype" Or comboField.Name = "cmb_r_maintype" Or comboField.Name = "cmb_a_maintype" Or comboField.Name = "cmb_x_maintype" Or comboField.Name = "cmb_9_maintype" Or comboField.Name = "cmb_8_maintype" Or comboField.Name = "cmb_7_maintype" Or comboField.Name = "cmb_6_maintype" Or comboField.Name = "cmb_w_maintype" Or comboField.Name = "cmb_3_maintype" Or comboField.Name = "cmb_4_maintype" Then
            '        cmd.Parameters.AddWithValue("@stypes", "MAIN TYPE")
            '    End If
            '    If comboField.Name = "cmb_y_testedwith" Or comboField.Name = "cmb_q_testedwith" Or comboField.Name = "cmb_r_testedwith" Or comboField.Name = "cmb_a_testedwith" Or comboField.Name = "cmb_x_testedwith" Or comboField.Name = "cmb_6_testedwith" Or comboField.Name = "cmb_w_testedwith" Or comboField.Name = "cmb_4_testedwith" Then
            '        cmd.Parameters.AddWithValue("@stypes", "TESTED WITH")
            '    End If
            '    If comboField.Name = "cmb_y_testedto" Or comboField.Name = "cmb_q_testedto" Or comboField.Name = "cmb_r_testedto" Or comboField.Name = "cmb_x_testedto" Or comboField.Name = "cmb_6_testedto" Or comboField.Name = "cmb_w_testedto" Or comboField.Name = "cmb_4_testedto" Then
            '        cmd.Parameters.AddWithValue("@stypes", "TESTED TO")
            '    End If
            '    If comboField.Name = "cmb_y_city" Or comboField.Name = "cmb_q_city" Or comboField.Name = "cmb_r_city" Or comboField.Name = "cmb_a_city" Or comboField.Name = "cmb_x_city" Or comboField.Name = "cmb_9_city" Or comboField.Name = "cmb_8_city" Or comboField.Name = "cmb_7_city" Or comboField.Name = "cmb_6_city" Or comboField.Name = "cmb_w_city" Or comboField.Name = "cmb_3_city" Or comboField.Name = "cmb_4_city" Or comboField.Name = "cmb_5_city" Then
            '        cmd.Parameters.AddWithValue("@stypes", "CITY")
            '    End If
            '    If comboField.Name = "cmb_y_pressure" Or comboField.Name = "cmb_w_pressure" Or comboField.Name = "cmb_3_pressure" Or comboField.Name = "cmb_4_pressure" Then
            '        cmd.Parameters.AddWithValue("@stypes", "PRESSURE")
            '    End If
            '    If comboField.Name = "cmb_q_coating" Or comboField.Name = "cmb_x_coating" Or comboField.Name = "cmb_9_coating" Or comboField.Name = "cmb_8_coating" Or comboField.Name = "cmb_7_coating" Then
            '        cmd.Parameters.AddWithValue("@stypes", "Type_of_coating")
            '    End If
            '    If comboField.Name = "cmb_r_connection_data" Then
            '        cmd.Parameters.AddWithValue("@stypes", "connection_data")
            '    End If
            '    If comboField.Name = "cmb_a_reasonabandon" Then
            '        cmd.Parameters.AddWithValue("@stypes", "Reason_of_abandon")
            '    End If
            '    If comboField.Name = "cmb_l_misCtype" Then
            '        cmd.Parameters.AddWithValue("@stypes", "Misc_Card_Type")
            '    End If
            '    If comboField.Name = "cmb_7_naturework" Then
            '        cmd.Parameters.AddWithValue("@stypes", "Nature_of_work")
            '    End If
            '    If comboField.Name = "cmb_7_kindjoint" Then
            '        cmd.Parameters.AddWithValue("@stypes", "Kind_of_joint")
            '    End If

            If cmdText = "SO_FrmQagettownname" Then
                Dim house_no As String = ""
                Dim ADDR_PREFIX_1 As String = ""
                Dim ADDR_PREFIX_2 As String = ""
                Dim STREET_NM As String = ""
                Dim ADDR_SUFFIX_CD As String = ""
                Dim STREET_SUFFIX_CD As String = ""
                Dim cities As String = ""

                If cmb_formtype.Text.Trim = "FORM-100BLK" Then
                    house_no = txt_100b_add1.Text
                    ADDR_PREFIX_1 = cmb_100b_add2.Text
                    ADDR_PREFIX_2 = cmb_100b_add2_1.Text
                    STREET_NM = cmb_100b_add3.Text
                    ADDR_SUFFIX_CD = cmb_100b_add4_1.Text
                    STREET_SUFFIX_CD = cmb_100b_add4.Text
                    cities = txt_div.Text

                ElseIf cmb_formtype.Text.Trim = "FORM-100BLK-MISC" Then
                    house_no = txt_100b_m_add1.Text
                    ADDR_PREFIX_1 = cmb_100b_m_add2.Text
                    ADDR_PREFIX_2 = cmb_100b_m_add2_1.Text
                    STREET_NM = cmb_100b_m_add3.Text
                    ADDR_SUFFIX_CD = cmb_100b_m_add4_1.Text
                    STREET_SUFFIX_CD = cmb_100b_m_add4.Text
                    cities = txt_div.Text

                ElseIf cmb_formtype.Text.Trim = "FORM-200BLK" Then
                    house_no = txthouseNo1.Text
                    ADDR_PREFIX_1 = cmbPrefix11.Text
                    ADDR_PREFIX_2 = cmbPrefix22.Text
                    STREET_NM = cmbStreetname1.Text
                    ADDR_SUFFIX_CD = cmbsuffix12.Text
                    STREET_SUFFIX_CD = cmbsuffix22.Text
                    cities = txt_div.Text

                ElseIf cmb_formtype.Text.Trim = "Yellow" Then
                    house_no = txt_y_add1.Text
                    ADDR_PREFIX_1 = cmb_y_add2.Text
                    ADDR_PREFIX_2 = cmb_y_add2_1.Text
                    STREET_NM = cmb_y_add3.Text
                    ADDR_SUFFIX_CD = cmb_y_add4_1.Text
                    STREET_SUFFIX_CD = cmb_y_add4.Text
                    cities = txt_div.Text

                ElseIf cmb_formtype.Text.Trim = "ORIGINAL" Then
                    house_no = txt_q_add1.Text
                    ADDR_PREFIX_1 = cmb_q_add2.Text
                    ADDR_PREFIX_2 = cmb_q_add2_1.Text
                    STREET_NM = cmb_q_add3.Text
                    ADDR_SUFFIX_CD = cmb_q_add4_1.Text
                    STREET_SUFFIX_CD = cmb_q_add4.Text
                    cities = txt_div.Text
                    ' Me.txt_q_premiseno.Text = ""
                ElseIf cmb_formtype.Text.Trim = "MISC" Then
                    house_no = txt_l_add1.Text
                    ADDR_PREFIX_1 = cmb_l_add2.Text
                    ADDR_PREFIX_2 = cmb_l_add2_1.Text
                    STREET_NM = cmb_l_add3.Text
                    ADDR_SUFFIX_CD = cmb_l_add4_1.Text
                    STREET_SUFFIX_CD = cmb_l_add4.Text
                    cities = txt_div.Text
                    'Me.txt_l_premiseno.Text = ""
                ElseIf cmb_formtype.Text.Trim = "ORIGINAL-R" Then
                    house_no = txt_r_add1.Text
                    ADDR_PREFIX_1 = cmb_r_add2.Text
                    ADDR_PREFIX_2 = cmb_r_add2_1.Text
                    STREET_NM = cmb_r_add3.Text
                    ADDR_SUFFIX_CD = cmb_r_add4_1.Text
                    STREET_SUFFIX_CD = cmb_r_add4.Text
                    cities = txt_div.Text
                    'Me.txt_r_premiseno.Text = ""
                ElseIf cmb_formtype.Text.Trim = "ABANDON-II" Then
                    house_no = txt_a_add1.Text
                    ADDR_PREFIX_1 = cmb_a_add2.Text
                    ADDR_PREFIX_2 = cmb_a_add2_1.Text
                    STREET_NM = cmb_a_add3.Text
                    ADDR_SUFFIX_CD = cmb_a_add4_1.Text
                    STREET_SUFFIX_CD = cmb_a_add4.Text
                    cities = txt_div.Text
                    'Me.txt_a_premiseno.Text = ""
                ElseIf cmb_formtype.Text.Trim = "Form-X" Then
                    house_no = txt_x_add1.Text
                    ADDR_PREFIX_1 = cmb_x_add2.Text
                    ADDR_PREFIX_2 = cmb_x_add2_1.Text
                    STREET_NM = cmb_x_add3.Text
                    ADDR_SUFFIX_CD = cmb_x_add4_1.Text
                    STREET_SUFFIX_CD = cmb_x_add4.Text
                    cities = txt_div.Text
                    'Me.txt_x_premiseno.Text = ""
                ElseIf cmb_formtype.Text.Trim = "FORM-IX" Then
                    house_no = txt_9_add1.Text
                    ADDR_PREFIX_1 = cmb_9_add2.Text
                    ADDR_PREFIX_2 = cmb_9_add2_1.Text
                    STREET_NM = cmb_9_add3.Text
                    ADDR_SUFFIX_CD = cmb_9_add4_1.Text
                    STREET_SUFFIX_CD = cmb_9_add4.Text
                    cities = txt_div.Text
                    'Me.txt_9_premiseno.Text = ""
                ElseIf cmb_formtype.Text.Trim = "Form-954" Then
                    house_no = txt_7_add1.Text
                    ADDR_PREFIX_1 = cmb_7_add2.Text
                    ADDR_PREFIX_2 = cmb_7_add2_1.Text
                    STREET_NM = cmb_7_add3.Text
                    ADDR_SUFFIX_CD = cmb_7_add4_1.Text
                    STREET_SUFFIX_CD = cmb_7_add4.Text
                    cities = txt_div.Text
                    'Me.txt_7_premiseno.Text = ""
                ElseIf cmb_formtype.Text.Trim = "ABANDON-I" Then
                    house_no = txt_8_add1.Text
                    ADDR_PREFIX_1 = cmb_8_add2.Text
                    ADDR_PREFIX_2 = cmb_8_add2_1.Text
                    STREET_NM = cmb_8_add3.Text
                    ADDR_SUFFIX_CD = cmb_8_add4_1.Text
                    STREET_SUFFIX_CD = cmb_8_add4.Text
                    cities = txt_div.Text
                    'Me.txt_8_premiseno.Text = ""
                ElseIf cmb_formtype.Text.Trim = "Form-80I" Then
                    house_no = txt_6_add1.Text
                    ADDR_PREFIX_1 = cmb_6_add2.Text
                    ADDR_PREFIX_2 = cmb_6_add2_1.Text
                    STREET_NM = cmb_6_add3.Text
                    ADDR_SUFFIX_CD = cmb_6_add4_1.Text
                    STREET_SUFFIX_CD = cmb_6_add4.Text
                    cities = txt_div.Text
                    'Me.txt_6_premiseno.Text = ""
                ElseIf cmb_formtype.Text.Trim = "OD-9-6-38" Then
                    house_no = txt_5_add1.Text
                    ADDR_PREFIX_1 = cmb_5_add2.Text
                    ADDR_PREFIX_2 = cmb_5_add2_1.Text
                    STREET_NM = cmb_5_add3.Text
                    ADDR_SUFFIX_CD = cmb_5_add4_1.Text
                    STREET_SUFFIX_CD = cmb_5_add4.Text
                    cities = txt_div.Text
                    'Me.txt_5_premiseno.Text = ""
                ElseIf cmb_formtype.Text.Trim = "Form235-B-702" Then
                    house_no = txt_4_add1.Text
                    ADDR_PREFIX_1 = cmb_4_add2.Text
                    ADDR_PREFIX_2 = cmb_4_add2_1.Text
                    STREET_NM = cmb_4_add3.Text
                    ADDR_SUFFIX_CD = cmb_4_add4_1.Text
                    STREET_SUFFIX_CD = cmb_4_add4.Text
                    cities = txt_div.Text
                    'txt_4_premiseno.Text = ""
                ElseIf cmb_formtype.Text.Trim = "White" Then
                    house_no = txt_w_add1.Text
                    ADDR_PREFIX_1 = cmb_w_add2.Text
                    ADDR_PREFIX_2 = cmb_w_add2_1.Text
                    STREET_NM = cmb_w_add3.Text
                    ADDR_SUFFIX_CD = cmb_w_add4_1.Text
                    STREET_SUFFIX_CD = cmb_w_add4.Text
                    cities = txt_div.Text
                    'Me.txt_w_premiseno.Text = ""
                ElseIf Me.cmb_formtype.Text.Trim = "Orange" Then
                    house_no = txt_3_add1.Text
                    ADDR_PREFIX_1 = cmb_3_add2.Text
                    ADDR_PREFIX_2 = cmb_3_add2_1.Text
                    STREET_NM = cmb_3_add3.Text
                    ADDR_SUFFIX_CD = cmb_3_add4_1.Text
                    STREET_SUFFIX_CD = cmb_3_add4.Text
                    cities = txt_div.Text
                    'txt_3_premiseno.Text = ""
                End If
                cmd.Parameters.AddWithValue("@HOUSE_NO", house_no)
                cmd.Parameters.AddWithValue("@ADDR_PREFIX_1", ADDR_PREFIX_1)
                cmd.Parameters.AddWithValue("@ADDR_PREFIX_2", ADDR_PREFIX_2)
                cmd.Parameters.AddWithValue("@STREET_NM", STREET_NM)
                cmd.Parameters.AddWithValue("@STREET_SUFFIX_CD", ADDR_SUFFIX_CD)
                cmd.Parameters.AddWithValue("@divison", cities)

            End If
            If (conn1.State = ConnectionState.Closed) Then
                conn1.Open()
            End If
            Dim ds As New DataSet()
            ds.Tables.Clear()
            'Dim da As New SqlDataAdapter(cmd.CommandText, conn1)
            Dim da As New SqlDataAdapter(cmd)
            da.Fill(ds)
            comboField.DataSource = ds.Tables(0)
            comboField.DisplayMember = "t_values"
            comboField.ValueMember = "t_values"
            comboField.SelectedIndex = -1
        Catch ex As Exception
            MessageBox.Show(ex.Message, Me.Text, MessageBoxButtons.OK, MessageBoxIcon.Stop)
        Finally
            conn1.Close()
            cmd = Nothing
        End Try

    End Sub
    Private Sub Fill_Streetname(ByVal comboField As ComboBox, ByVal HOUSE_NO As String, ByVal ADDR_PREFIX_1 As String, ByVal ADDR_PREFIX_2 As String)
        'comboField.Items.Clear()

        Dim house, add_prefix1, add_prefix2 As String

        If HOUSE_NO.Trim.Length = 0 Then
            house = ""
        Else
            house = HOUSE_NO
        End If
        If ADDR_PREFIX_1.Trim.Length = 0 Then
            add_prefix1 = ""
        Else
            add_prefix1 = ADDR_PREFIX_1
        End If
        If ADDR_PREFIX_2.Trim.Length = 0 Then
            add_prefix2 = ""
        Else
            add_prefix2 = ADDR_PREFIX_2
        End If




        Dim cmdtext As String
        cmdtext = "Fill_Streetname"

        cmd = Nothing
        Try
            cmd = New SqlCommand(cmdtext, conn)
            cmd.CommandType = CommandType.StoredProcedure
            cmd.Parameters.AddWithValue("@HOUSE_NO", house)
            cmd.Parameters.AddWithValue("@ADDR_PREFIX_1", add_prefix1)
            cmd.Parameters.AddWithValue("@ADDR_PREFIX_2", add_prefix2)
            If (conn.State = ConnectionState.Closed) Then
                conn.Open()
            End If
            Dim ds As New DataSet()
            ds.Tables.Clear()
            Dim da As New SqlDataAdapter(cmd)
            da.Fill(ds)
            comboField.DataSource = ds.Tables(0)
            comboField.DisplayMember = "street_nm"
            comboField.ValueMember = "street_nm"
            comboField.SelectedIndex = -1
        Catch ex As Exception
            MessageBox.Show(ex.Message, Me.Text, MessageBoxButtons.OK, MessageBoxIcon.Stop)
        Finally
            conn.Close()
        End Try

    End Sub
    Private Sub Fill_Streetprefix(ByVal comboField As ComboBox, ByVal HOUSE_NO As String, ByVal ADDR_PREFIX_1 As String, ByVal ADDR_PREFIX_2 As String, ByVal STREET_NM As String, ByVal ADDR_SUFFIX_CD As String)
        'comboField.Items.Clear()
        If (conn.State = ConnectionState.Closed) Then
            conn.Open()
        End If
        Dim cities As String = ""
        Dim house As String = ""
        Dim add_prefix1 As String = ""
        Dim add_prefix2 As String = ""
        Dim street As String = ""
        Dim add_prefix As String = ""

        If txt_div.Text.Trim = "Durham" Then
            cities = "DURHAM"
        ElseIf txt_div.Text.Trim = "Asheville" Then
            cities = "ASHEVILLE"
        ElseIf txt_div.Text.Trim = "Gastonia" Then
            cities = "GASTONIA"
        ElseIf txt_div.Text.Trim = "Raleigh" Then
            cities = "RALEIGH"

        ElseIf txt_div.Text.Trim = "CENTRAL" Then
            cities = "CENTRAL"
            'cities = "LOCAL_OFFICE_NO IN ('002' ,'005' ,'010', '008' ,'012' ,'014' ,'020' ,'053' ,'054' ,'083', '050' ) "
        ElseIf txt_div.Text.Trim = "EASTERN" Then
            cities = "EASTERN"
            'cities = "LOCAL_OFFICE_NO IN ('073', '075', '076', '084', '085', '086' )"
        ElseIf txt_div.Text.Trim = "COASTAL" Then
            cities = "COASTAL"
            ' cities = "LOCAL_OFFICE_NO IN ('087','088','094')"
        ElseIf txt_div.Text.Trim = "LOW COUNTRY" Then
            cities = "LOW COUNTRY"
            ' cities = "LOCAL_OFFICE_NO IN ('042', '060', '061', '065','080')"
        ElseIf txt_div.Text.Trim = "SOUTHERN" Then
            cities = "SOUTHERN"
            'cities = "LOCAL_OFFICE_NO IN ('023','070', '071', '080','090', '020' ,'091','092','095')"
        ElseIf txt_div.Text.Trim = "WESTERN" Then
            cities = "WESTERN"
            'cities = "LOCAL_OFFICE_NO IN ('010', '011', '030', '031', '032', '033', '035', '050','052','055', '089')"
        End If
        If HOUSE_NO.Trim.Length = 0 Then
            house = ""
        Else
            house = HOUSE_NO
        End If
        If ADDR_PREFIX_1.Trim.Length = 0 Then
            add_prefix1 = ""
        Else
            add_prefix1 = ADDR_PREFIX_1
        End If
        If ADDR_PREFIX_2.Trim.Length = 0 Then
            add_prefix2 = ""
        Else
            add_prefix2 = ADDR_PREFIX_2
        End If

        If STREET_NM.Trim.Length = 0 Then
            street = ""
        Else
            street = STREET_NM
        End If
        If ADDR_SUFFIX_CD.Trim.Length = 0 Then
            add_prefix = ""
        Else
            add_prefix = ADDR_SUFFIX_CD
        End If

        Dim cmdtext As String
        cmdtext = "Fill_Streetprefix"
        Dim dr As SqlDataReader = Nothing
        cmd = New SqlCommand(cmdtext, conn)
        cmd.CommandType = CommandType.StoredProcedure
        cmd.Parameters.AddWithValue("@HOUSE_NO", house)
        cmd.Parameters.AddWithValue("@ADDR_PREFIX_1", add_prefix1)
        cmd.Parameters.AddWithValue("@ADDR_PREFIX_2", add_prefix2)
        cmd.Parameters.AddWithValue("@STREET_NM", street)
        cmd.Parameters.AddWithValue("@ADDR_SUFFIX_CD", add_prefix)
        cmd.Parameters.AddWithValue("@divison", cities)

        dr = cmd.ExecuteReader(CommandBehavior.CloseConnection)
        If (dr.Read) Then
            comboField.Text = dr(0).ToString
        End If
        dr.Close()
        If (conn.State = ConnectionState.Open) Then
            conn.Close()
        End If
        'cmd = Nothing
        'Try
        '    cmd = New SqlCommand(cmdtext)
        '    If (conn.State = ConnectionState.Closed) Then
        '        conn.Open()
        '    End If
        '    Dim ds As New DataSet()
        '    ds.Tables.Clear()
        '    Dim da As New SqlDataAdapter(cmd.CommandText, conn)
        '    da.Fill(ds)
        '    comboField.DataSource = ds.Tables(0)
        '    comboField.DisplayMember = "street_suffix_cd"
        '    comboField.ValueMember = "street_suffix_cd"
        '    comboField.SelectedIndex = -1
        'Catch ex As Exception
        '    MessageBox.Show(ex.Message, Me.Text, MessageBoxButtons.OK, MessageBoxIcon.Stop)
        'Finally
        '    conn.Close()
        'End Try

    End Sub
    Private Sub getfiledata(ByVal file_id As Integer)
        If conn.State = 0 Then
            conn.Open()
        End If
        Dim pipe_size As String = String.Empty
        Dim add_streetno As String = String.Empty
        Dim file_type As String = String.Empty
        Dim add_prefix As String = String.Empty
        Dim add_prefix_2 As String = String.Empty
        Dim add_streetname As String = String.Empty
        Dim add_suffix As String = String.Empty
        Dim street_suffix_cd As String = String.Empty
        Dim name As String = String.Empty
        Dim date_installed As String = String.Empty
        Dim city As String = String.Empty
        Dim subdivision As String = String.Empty
        Dim service_wo_no As String = String.Empty
        Dim pipe_type As String = String.Empty
        Dim pressure As String = String.Empty
        Dim size_of_tap As String = String.Empty
        Dim length_main_to_curb_valve_ft As Integer
        Dim length_main_to_curb_valve_in As Integer
        Dim length_curb_valve_to_property_line_ft As Integer
        Dim length_curb_valve_to_property_line_in As Integer
        Dim length_main_to_property_line_ft As Integer
        Dim length_main_to_property_line_in As Integer
        Dim length_property_line_to_meter_ft As Integer
        Dim length_property_line_to_meter_in As Integer
        Dim size_of_main As String = String.Empty
        Dim type_of_main As String = String.Empty
        Dim depth_of_main As String = String.Empty
        Dim tested_with As String = String.Empty
        Dim tested_to As String = String.Empty
        Dim psig_for_minutes As String = String.Empty
        Dim foreman As String = String.Empty
        Dim PREMISE_NO As String = String.Empty
        Dim f_stub As String = String.Empty
        Dim f_inserted As String = String.Empty
        Dim f_retired As String = String.Empty
        Dim f_leak As String = String.Empty
        Dim f_split As String = String.Empty
        Dim pipe_condition As String = String.Empty
        Dim lenmtrtomain As Integer
        Dim sceginspect As String = String.Empty
        Dim nature_of_work As String = String.Empty
        Dim kind_of_joint As String = String.Empty
        Dim split_sleeve As String = String.Empty
        Dim loc_of_cock As String = String.Empty
        Dim kind_of_box As String = String.Empty
        Dim type_coating As String = String.Empty
        Dim DATE_ABANDON As String = String.Empty
        Dim reason_of_abandon As String = String.Empty
        Dim f_noblow As String = String.Empty
        Dim f_gassource As String = String.Empty
        Dim f_tappingtee As String = String.Empty
        Dim f_linesealed As String = String.Empty
        Dim f_defcoatcor As String = String.Empty
        Dim f_multimeter As String = String.Empty
        Dim f_serstop As String = String.Empty
        Dim f_cathodpro As String = String.Empty
        Dim f_tee As String = String.Empty
        Dim f_taptee As String = String.Empty
        Dim f_galvanized As String = String.Empty
        Dim tap_t_size As String = String.Empty
        Dim tap_t_inlet As String = String.Empty
        Dim tap_t_outlet As String = String.Empty
        Dim f_insulated As String = String.Empty
        Dim f_anoderiser As String = String.Empty
        Dim otheranode_lbs As String = String.Empty
        Dim connection_data As String = String.Empty
        Dim misc_card_type As String = String.Empty
        Dim f_relocate As String = String.Empty
        Dim f_replace As String = String.Empty
        Dim STREET_LOCATION_2_CD As String = String.Empty
        Dim STREET_LOCATION_1_CD As String = String.Empty
        Dim installed_by_contractor As String = String.Empty

        If radbtnmissmatch.Checked = True Then
            Dim cmdtext As String = "SO_Getunmatcheddata"
            cmd = Nothing
            cmd = New SqlCommand(cmdtext, conn)
            cmd.CommandType = CommandType.StoredProcedure
            cmd.Parameters.AddWithValue("@fileid", file_id)
            Dim ds As New DataSet
            Dim da As New SqlDataAdapter(cmd)
            da.Fill(ds)
            If ds.Tables(0).Rows(0).Item("add_streetno").ToString.Trim <> ds.Tables(0).Rows(1).Item("add_streetno").ToString.Trim Then
                add_streetno = "add_streetno"
            End If
            If ds.Tables(0).Rows(0).Item("file_type").ToString.Trim <> ds.Tables(0).Rows(1).Item("file_type").ToString.Trim Then
                file_type = "file_type"
            End If
            If ds.Tables(0).Rows(0).Item("add_prefix").ToString.Trim <> ds.Tables(0).Rows(1).Item("add_prefix").ToString.Trim Then
                add_prefix = "add_prefix"
            End If
            If ds.Tables(0).Rows(0).Item("add_prefix_2").ToString.Trim <> ds.Tables(0).Rows(1).Item("add_prefix_2").ToString.Trim Then
                add_prefix_2 = "add_prefix_2"
            End If
            If ds.Tables(0).Rows(0).Item("add_streetname").ToString.Trim <> ds.Tables(0).Rows(1).Item("add_streetname").ToString.Trim Then
                add_streetname = "add_streetname"
            End If
            If ds.Tables(0).Rows(0).Item("add_suffix").ToString.Trim <> ds.Tables(0).Rows(1).Item("add_suffix").ToString.Trim Then
                add_suffix = "add_suffix"
            End If
            If ds.Tables(0).Rows(0).Item("street_suffix_cd").ToString.Trim <> ds.Tables(0).Rows(1).Item("street_suffix_cd").ToString.Trim Then
                street_suffix_cd = "street_suffix_cd"
            End If
            If ds.Tables(0).Rows(0).Item("name").ToString.Trim <> ds.Tables(0).Rows(1).Item("name").ToString.Trim Then
                name = "name"
            End If
            If ds.Tables(0).Rows(0).Item("date_installed").ToString.Trim <> ds.Tables(0).Rows(1).Item("date_installed").ToString.Trim Then
                date_installed = "date_installed"
            End If
            If ds.Tables(0).Rows(0).Item("city").ToString.Trim <> ds.Tables(0).Rows(1).Item("city").ToString.Trim Then
                city = "city"
            End If
            If ds.Tables(0).Rows(0).Item("subdivision").ToString.Trim <> ds.Tables(0).Rows(1).Item("subdivision").ToString.Trim Then
                subdivision = "subdivision"
            End If
            If ds.Tables(0).Rows(0).Item("service_wo_no").ToString.Trim <> ds.Tables(0).Rows(1).Item("service_wo_no").ToString.Trim Then
                service_wo_no = "service_wo_no"
            End If
            If ds.Tables(0).Rows(0).Item("pipe_size").ToString.Trim <> ds.Tables(0).Rows(1).Item("pipe_size").ToString.Trim Then
                pipe_size = "pipe_size"
            End If
            If ds.Tables(0).Rows(0).Item("pipe_type").ToString.Trim <> ds.Tables(0).Rows(1).Item("pipe_type").ToString.Trim Then
                pipe_type = "pipe_type"
            End If
            If ds.Tables(0).Rows(0).Item("pressure").ToString.Trim <> ds.Tables(0).Rows(1).Item("pressure").ToString.Trim Then
                pressure = "pressure"
            End If
            If ds.Tables(0).Rows(0).Item("size_of_tap").ToString.Trim <> ds.Tables(0).Rows(1).Item("size_of_tap").ToString.Trim Then
                size_of_tap = "size_of_tap"
            End If
            If ds.Tables(0).Rows(0).Item("length_main_to_curb_valve_ft").ToString.Trim <> ds.Tables(0).Rows(1).Item("length_main_to_curb_valve_ft").ToString.Trim Then
                length_main_to_curb_valve_ft = 12345
            End If
            If ds.Tables(0).Rows(0).Item("length_main_to_curb_valve_in").ToString.Trim <> ds.Tables(0).Rows(1).Item("length_main_to_curb_valve_in").ToString.Trim Then
                length_main_to_curb_valve_in = 12345
            End If
            If ds.Tables(0).Rows(0).Item("length_curb_valve_to_property_line_ft").ToString.Trim <> ds.Tables(0).Rows(1).Item("length_curb_valve_to_property_line_ft").ToString.Trim Then
                length_curb_valve_to_property_line_ft = 12345
            End If
            If ds.Tables(0).Rows(0).Item("length_curb_valve_to_property_line_in").ToString.Trim <> ds.Tables(0).Rows(1).Item("length_curb_valve_to_property_line_in").ToString.Trim Then
                length_curb_valve_to_property_line_in = 12345
            End If
            If ds.Tables(0).Rows(0).Item("length_main_to_property_line_ft").ToString.Trim <> ds.Tables(0).Rows(1).Item("length_main_to_property_line_ft").ToString.Trim Then
                length_main_to_property_line_ft = 12345
            End If
            If ds.Tables(0).Rows(0).Item("length_main_to_property_line_in").ToString.Trim <> ds.Tables(0).Rows(1).Item("length_main_to_property_line_in").ToString.Trim Then
                length_main_to_property_line_in = 12345
            End If
            If ds.Tables(0).Rows(0).Item("length_property_line_to_meter_ft").ToString.Trim <> ds.Tables(0).Rows(1).Item("length_property_line_to_meter_ft").ToString.Trim Then
                length_property_line_to_meter_ft = 12345
            End If
            If ds.Tables(0).Rows(0).Item("length_property_line_to_meter_in").ToString.Trim <> ds.Tables(0).Rows(1).Item("length_property_line_to_meter_in").ToString.Trim Then
                length_property_line_to_meter_in = 12345
            End If
            If ds.Tables(0).Rows(0).Item("size_of_main").ToString.Trim <> ds.Tables(0).Rows(1).Item("size_of_main").ToString.Trim Then
                size_of_main = "size_of_main"
            End If
            If ds.Tables(0).Rows(0).Item("type_of_main").ToString.Trim <> ds.Tables(0).Rows(1).Item("type_of_main").ToString.Trim Then
                type_of_main = "type_of_main"
            End If
            If ds.Tables(0).Rows(0).Item("depth_of_main").ToString.Trim <> ds.Tables(0).Rows(1).Item("depth_of_main").ToString.Trim Then
                depth_of_main = "depth_of_main"
            End If
            If ds.Tables(0).Rows(0).Item("tested_with").ToString.Trim <> ds.Tables(0).Rows(1).Item("tested_with").ToString.Trim Then
                tested_with = "tested_with"
            End If
            If ds.Tables(0).Rows(0).Item("tested_to").ToString.Trim <> ds.Tables(0).Rows(1).Item("tested_to").ToString.Trim Then
                tested_to = "tested_to"
            End If
            If ds.Tables(0).Rows(0).Item("psig_for_minutes").ToString.Trim <> ds.Tables(0).Rows(1).Item("psig_for_minutes").ToString.Trim Then
                psig_for_minutes = "psig_for_minutes"
            End If
            If ds.Tables(0).Rows(0).Item("installed_by_contractor").ToString.Trim <> ds.Tables(0).Rows(1).Item("installed_by_contractor").ToString.Trim Then
                installed_by_contractor = "installed_by_contractor"
            End If
            If ds.Tables(0).Rows(0).Item("foreman").ToString.Trim <> ds.Tables(0).Rows(1).Item("foreman").ToString.Trim Then
                foreman = "foreman"
            End If
            If ds.Tables(0).Rows(0).Item("PREMISE_NO").ToString.Trim <> ds.Tables(0).Rows(1).Item("PREMISE_NO").ToString.Trim Then
                PREMISE_NO = "PREMISE_NO"
            End If
            If ds.Tables(0).Rows(0).Item("f_stub").ToString.Trim <> ds.Tables(0).Rows(1).Item("f_stub").ToString.Trim Then
                f_stub = "f_stub"
            End If
            If ds.Tables(0).Rows(0).Item("f_inserted").ToString.Trim <> ds.Tables(0).Rows(1).Item("f_inserted").ToString.Trim Then
                f_inserted = "f_inserted"
            End If
            If ds.Tables(0).Rows(0).Item("f_retired").ToString.Trim <> ds.Tables(0).Rows(1).Item("f_retired").ToString.Trim Then
                f_retired = "f_retired"
            End If
            If ds.Tables(0).Rows(0).Item("f_leak").ToString.Trim <> ds.Tables(0).Rows(1).Item("f_leak").ToString.Trim Then
                f_leak = "f_leak"
            End If
            If ds.Tables(0).Rows(0).Item("f_split").ToString.Trim <> ds.Tables(0).Rows(1).Item("f_split").ToString.Trim Then
                f_split = "f_split"
            End If
            If ds.Tables(0).Rows(0).Item("pipe_condition").ToString.Trim <> ds.Tables(0).Rows(1).Item("pipe_condition").ToString.Trim Then
                pipe_condition = "pipe_condition"
            End If
            If ds.Tables(0).Rows(0).Item("lenmtrtomain").ToString.Trim <> ds.Tables(0).Rows(1).Item("lenmtrtomain").ToString.Trim Then
                lenmtrtomain = 12345
            End If
            If ds.Tables(0).Rows(0).Item("sceginspect").ToString.Trim <> ds.Tables(0).Rows(1).Item("sceginspect").ToString.Trim Then
                sceginspect = "sceginspect"
            End If
            If ds.Tables(0).Rows(0).Item("nature_of_work").ToString.Trim <> ds.Tables(0).Rows(1).Item("nature_of_work").ToString.Trim Then
                nature_of_work = "nature_of_work"
            End If
            If ds.Tables(0).Rows(0).Item("kind_of_joint").ToString.Trim <> ds.Tables(0).Rows(1).Item("kind_of_joint").ToString.Trim Then
                kind_of_joint = "kind_of_joint"
            End If
            If ds.Tables(0).Rows(0).Item("split_sleeve").ToString.Trim <> ds.Tables(0).Rows(1).Item("split_sleeve").ToString.Trim Then
                split_sleeve = "split_sleeve"
            End If
            If ds.Tables(0).Rows(0).Item("loc_of_cock").ToString.Trim <> ds.Tables(0).Rows(1).Item("loc_of_cock").ToString.Trim Then
                loc_of_cock = "loc_of_cock"
            End If
            If ds.Tables(0).Rows(0).Item("kind_of_box").ToString.Trim <> ds.Tables(0).Rows(1).Item("kind_of_box").ToString.Trim Then
                kind_of_box = "kind_of_box"
            End If
            If ds.Tables(0).Rows(0).Item("type_coating").ToString.Trim <> ds.Tables(0).Rows(1).Item("type_coating").ToString.Trim Then
                type_coating = "type_coating"
            End If
            If ds.Tables(0).Rows(0).Item("DATE_ABANDON").ToString.Trim <> ds.Tables(0).Rows(1).Item("DATE_ABANDON").ToString.Trim Then
                DATE_ABANDON = "DATE_ABANDON"
            End If
            If ds.Tables(0).Rows(0).Item("reason_of_abandon").ToString.Trim <> ds.Tables(0).Rows(1).Item("reason_of_abandon").ToString.Trim Then
                reason_of_abandon = "reason_of_abandon"
            End If
            If ds.Tables(0).Rows(0).Item("f_noblow").ToString.Trim <> ds.Tables(0).Rows(1).Item("f_noblow").ToString.Trim Then
                f_noblow = "f_noblow"
            End If
            If ds.Tables(0).Rows(0).Item("f_gassource").ToString.Trim <> ds.Tables(0).Rows(1).Item("f_gassource").ToString.Trim Then
                f_gassource = "f_gassource"
            End If
            If ds.Tables(0).Rows(0).Item("f_tappingtee").ToString.Trim <> ds.Tables(0).Rows(1).Item("f_tappingtee").ToString.Trim Then
                f_tappingtee = "f_tappingtee"
            End If
            If ds.Tables(0).Rows(0).Item("f_linesealed").ToString.Trim <> ds.Tables(0).Rows(1).Item("f_linesealed").ToString.Trim Then
                f_linesealed = "f_linesealed"
            End If
            If ds.Tables(0).Rows(0).Item("f_defcoatcor").ToString.Trim <> ds.Tables(0).Rows(1).Item("f_defcoatcor").ToString.Trim Then
                f_defcoatcor = "f_defcoatcor"
            End If
            If ds.Tables(0).Rows(0).Item("f_multimeter").ToString.Trim <> ds.Tables(0).Rows(1).Item("f_multimeter").ToString.Trim Then
                f_multimeter = "f_multimeter"
            End If
            If ds.Tables(0).Rows(0).Item("f_serstop").ToString.Trim <> ds.Tables(0).Rows(1).Item("f_serstop").ToString.Trim Then
                f_serstop = "f_serstop"
            End If
            If ds.Tables(0).Rows(0).Item("f_cathodpro").ToString.Trim <> ds.Tables(0).Rows(1).Item("f_cathodpro").ToString.Trim Then
                f_cathodpro = "f_cathodpro"
            End If
            If ds.Tables(0).Rows(0).Item("f_tee").ToString.Trim <> ds.Tables(0).Rows(1).Item("f_tee").ToString.Trim Then
                f_tee = "f_tee"
            End If
            If ds.Tables(0).Rows(0).Item("f_taptee").ToString.Trim <> ds.Tables(0).Rows(1).Item("f_taptee").ToString.Trim Then
                f_taptee = "f_taptee"
            End If
            If ds.Tables(0).Rows(0).Item("f_galvanized").ToString.Trim <> ds.Tables(0).Rows(1).Item("f_galvanized").ToString.Trim Then
                f_galvanized = "f_galvanized"
            End If
            If ds.Tables(0).Rows(0).Item("tap_t_size").ToString.Trim <> ds.Tables(0).Rows(1).Item("tap_t_size").ToString.Trim Then
                tap_t_size = "tap_t_size"
            End If
            If ds.Tables(0).Rows(0).Item("tap_t_inlet").ToString.Trim <> ds.Tables(0).Rows(1).Item("tap_t_inlet").ToString.Trim Then
                tap_t_inlet = "tap_t_inlet"
            End If
            If ds.Tables(0).Rows(0).Item("tap_t_outlet").ToString.Trim <> ds.Tables(0).Rows(1).Item("tap_t_outlet").ToString.Trim Then
                tap_t_outlet = "tap_t_outlet"
            End If
            If ds.Tables(0).Rows(0).Item("f_insulated").ToString.Trim <> ds.Tables(0).Rows(1).Item("f_insulated").ToString.Trim Then
                f_insulated = "f_insulated"
            End If
            If ds.Tables(0).Rows(0).Item("f_anoderiser").ToString.Trim <> ds.Tables(0).Rows(1).Item("f_anoderiser").ToString.Trim Then
                f_anoderiser = "f_anoderiser"
            End If
            If ds.Tables(0).Rows(0).Item("otheranode_lbs").ToString.Trim <> ds.Tables(0).Rows(1).Item("otheranode_lbs").ToString.Trim Then
                otheranode_lbs = "otheranode_lbs"
            End If
            If ds.Tables(0).Rows(0).Item("connection_data").ToString.Trim <> ds.Tables(0).Rows(1).Item("connection_data").ToString.Trim Then
                connection_data = "connection_data"
            End If
            If ds.Tables(0).Rows(0).Item("misc_card_type").ToString.Trim <> ds.Tables(0).Rows(1).Item("misc_card_type").ToString.Trim Then
                misc_card_type = "misc_card_type"
            End If
            If ds.Tables(0).Rows(0).Item("f_relocate").ToString.Trim <> ds.Tables(0).Rows(1).Item("f_relocate").ToString.Trim Then
                f_relocate = "f_relocate"
            End If
            If ds.Tables(0).Rows(0).Item("f_replace").ToString.Trim <> ds.Tables(0).Rows(1).Item("f_replace").ToString.Trim Then
                f_replace = "f_replace"
            End If
            If ds.Tables(0).Rows(0).Item("STREET_LOCATION_2_CD").ToString.Trim <> ds.Tables(0).Rows(1).Item("STREET_LOCATION_2_CD").ToString.Trim Then
                STREET_LOCATION_2_CD = "STREET_LOCATION_2_CD"
            End If
            If ds.Tables(0).Rows(0).Item("STREET_LOCATION_1_CD").ToString.Trim <> ds.Tables(0).Rows(1).Item("STREET_LOCATION_1_CD").ToString.Trim Then
                STREET_LOCATION_1_CD = "STREET_LOCATION_1_CD"
            End If
            ds.Dispose()
        End If
        Dim dr As SqlDataReader = Nothing
        cmd = Nothing
        cmd = New SqlCommand("SO_FrmQagetfiledata", conn)
        cmd.CommandType = CommandType.StoredProcedure
        cmd.Parameters.AddWithValue("@fileid", file_id)
        dr = cmd.ExecuteReader(CommandBehavior.CloseConnection)
        If (dr.Read) Then
            Me.btn_submit.Text = "UPDATE"
            Me.cmb_formtype.Text = dr(2).ToString
            chk_relocate.Checked = dr(71).ToString
            chk_replace.Checked = dr(72).ToString
            txt_passcomment.Text = dr("last_remark").ToString

            ''Assign 100BLK
            If dr(2).ToString = "FORM-100BLK" Then
                txt_100b_add1.Text = dr(3).ToString
                cmb_100b_add2.Text = dr(4).ToString
                cmb_100b_add2_1.Text = dr(5).ToString
                cmb_100b_add3.Text = dr(6).ToString
                cmb_100b_add4_1.Text = dr(7).ToString
                cmb_100b_add4.Text = dr(8).ToString
                'txt_100b_name.Text = dr(9).ToString
                If CDate(dr(10).ToString) = #1/1/1900# Then
                    txt_100b_dated.Text = ""
                Else
                    txt_100b_dated.Text = Format(dr(10), "MM/dd/yyyy").ToString()
                End If
                If CDate(dr(50).ToString) = #1/1/1900# Then
                    txt_100b_dateabandon.Text = ""
                Else
                    txt_100b_dateabandon.Text = Format(dr(50), "MM/dd/yyyy").ToString()
                End If
                cmb_100b_city.Text = dr(11).ToString
                'txt_100b_subdiv.Text = dr(12).ToString
                'txt_100b_serno.Text = dr(13).ToString
                cmb_100b_pipesize.SelectedValue = dr(14).ToString
                cmb_100b_pipekind.SelectedValue = dr(15).ToString
                cmb_100b_pressure.SelectedValue = dr(16).ToString
                cmb_100b_tapsize.SelectedValue = dr(17).ToString
                'txt_100b_ser_ft.Text = dr(18).ToString
                'txt_100b_ser_in.Text = dr(19).ToString
                'txt_100b_depser_ft.Text = dr(20).ToString
                'txt_100b_depser_in.Text = dr(21).ToString
                txt_100b_mainln_ft.Text = dr(22).ToString
                'txt_100b_mainln_in.Text = dr(23).ToString
                txt_100b_propln_ft.Text = dr(24).ToString
                'txt_100b_propln_in.Text = dr(25).ToString
                cmb_100b_mainsize.SelectedValue = dr(26).ToString
                cmb_100b_maintype.SelectedValue = dr(27).ToString
                txt_100b_deptmain.Text = dr(28).ToString
                cmb_100b_testedwith.SelectedValue = dr(29).ToString
                cmb_100b_testedto.SelectedValue = dr(30).ToString
                txt_100b_psigmin.Text = dr(31).ToString
                'txt_100b_installedby.Text = dr(32).ToString
                'txt_100b_foreman.Text = dr(33).ToString
                txt_100b_remark.Text = dr(34).ToString
                txt_100b_premiseno.Text = dr(35).ToString
                chk_stub.Checked = dr(36).ToString
                chk_inserted.Checked = dr(37).ToString
                chk_retired.Checked = dr(38).ToString
                ckh_leak.Checked = dr(39).ToString
                chk_split.Checked = dr(40).ToString
                txt_100b_lenmtrtomain.Text = dr(42).ToString
                chk_relocate.Checked = dr(71).ToString
                chk_replace.Checked = dr(72).ToString
                cmb_loccd_1.Text = dr(73).ToString
                txt_loccd_2.Text = dr(74).ToString

                txt_100b_installedyear.Text = dr(75).ToString
                txt_100b_a_ps_reading.Text = dr(76).ToString
                txt_100b_tot_anodes_1.Text = dr(77).ToString
                txt_100b_tot_anodes_17.Text = dr(78).ToString
                txt_100b_lr.Text = dr(79).ToString
                txt_100b_incheswc.Text = dr(85).ToString

                If date_installed <> "" Then
                    txt_y_dated.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_y_dated.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
            End If
            ''Assign FORM-100BLK-MISC
            If dr(2).ToString = "FORM-100BLK-MISC" Then
                txt_100b_m_add1.Text = dr(3).ToString
                cmb_100b_m_add2.Text = dr(4).ToString
                cmb_100b_m_add2_1.Text = dr(5).ToString
                cmb_100b_m_add3.Text = dr(6).ToString
                cmb_100b_m_add4_1.Text = dr(7).ToString
                cmb_100b_m_add4.Text = dr(8).ToString
                'txt_100b_m_name.Text = dr(9).ToString
                If CDate(dr(10).ToString) = #1/1/1900# Then
                    txt_100b_m_dated.Text = ""
                Else
                    txt_100b_m_dated.Text = Format(dr(10), "MM/dd/yyyy").ToString()
                End If
                If CDate(dr(50).ToString) = #1/1/1900# Then
                    txt_100b_m_dateabandon.Text = ""
                Else
                    txt_100b_m_dateabandon.Text = Format(dr(50), "MM/dd/yyyy").ToString()
                End If
                cmb_100b_m_city.Text = dr(11).ToString
                'txt_100b_m_subdiv.Text = dr(12).ToString
                'txt_100b_m_serno.Text = dr(13).ToString
                cmb_100b_m_pipesize.SelectedValue = dr(14).ToString
                cmb_100b_m_pipekind.SelectedValue = dr(15).ToString
                cmb_100b_m_pressure.SelectedValue = dr(16).ToString
                cmb_100b_m_tapsize.SelectedValue = dr(17).ToString
                'txt_100b_m_ser_ft.Text = dr(18).ToString
                'txt_100b_m_ser_in.Text = dr(19).ToString
                'txt_100b_m_depser_ft.Text = dr(20).ToString
                'txt_100b_m_depser_in.Text = dr(21).ToString
                txt_100b_m_mainln_ft.Text = dr(22).ToString
                'txt_100b_m_mainln_in.Text = dr(23).ToString
                txt_100b_m_propln_ft.Text = dr(24).ToString
                'txt_100b_m_propln_in.Text = dr(25).ToString
                cmb_100b_m_mainsize.SelectedValue = dr(26).ToString
                cmb_100b_m_maintype.SelectedValue = dr(27).ToString
                txt_100b_m_deptmain.Text = dr(28).ToString
                cmb_100b_m_testedwith.SelectedValue = dr(29).ToString
                cmb_100b_m_testedto.SelectedValue = dr(30).ToString
                txt_100b_m_psigmin.Text = dr(31).ToString
                'txt_100b_m_installedby.Text = dr(32).ToString
                'txt_100b_m_foreman.Text = dr(33).ToString
                txt_100b_m_remark.Text = dr(34).ToString
                txt_100b_m_premiseno.Text = dr(35).ToString
                chk_stub.Checked = dr(36).ToString
                chk_inserted.Checked = dr(37).ToString
                chk_retired.Checked = dr(38).ToString
                ckh_leak.Checked = dr(39).ToString
                chk_split.Checked = dr(40).ToString
                txt_100b_m_lenmtrtomain.Text = dr(42).ToString
                chk_relocate.Checked = dr(71).ToString
                chk_replace.Checked = dr(72).ToString
                cmb_loccd_1.Text = dr(73).ToString
                txt_loccd_2.Text = dr(74).ToString

                txt_100b_m_installedyear.Text = dr(75).ToString
                txt_100b_m_a_ps_reading.Text = dr(76).ToString
                txt_100b_m_tot_anodes_1.Text = dr(77).ToString
                txt_100b_m_tot_anodes_17.Text = dr(78).ToString
                txt_100b_m_lr.Text = dr(79).ToString
                txt_100b_m_incheswc.Text = dr(85).ToString
            End If
            If dr(2).ToString = "FORM-200BLK" Then
                'txt_fileid.Text = ""
                'txt_filedesc.Text = ""
                'cmb_formtype.Text = ""
                txthouseNo1.Text = dr(3).ToString
                cmbPrefix11.Text = dr(4).ToString
                cmbPrefix22.Text = dr(5).ToString
                cmbStreetname1.Text = dr(6).ToString
                cmbsuffix12.Text = dr(7).ToString
                cmbsuffix22.Text = dr(8).ToString
                'txt_y_name.Text = dr(9).ToString
                If CDate(dr(10).ToString) = #1/1/1900# Then
                    txtDate1.Text = ""
                Else
                    txtDate1.Text = Format(dr(10), "MM/dd/yyyy").ToString()
                End If
                If CDate(dr(50).ToString) = #1/1/1900# Then
                    txt_Retired_date.Text = ""
                Else
                    txt_Retired_date.Text = Format(dr(50), "MM/dd/yyyy").ToString()
                End If
                cmb_200b_city.Text = dr(11).ToString
                cmb_pipe_size.SelectedValue = dr(14).ToString
                cmb_typeofservice.SelectedValue = dr(15).ToString
                cmbTapSize.SelectedValue = dr(17).ToString
                txtmainToBackOfCurb.Text = dr(18).ToString
                cmb_main_size.SelectedValue = dr(26).ToString
                cmb_main_type.SelectedValue = dr(27).ToString
                Me.txtDepthMain.Text = dr(28).ToString
                cmbMedium.SelectedValue = dr(29).ToString
                cmbPressure.SelectedValue = dr(30).ToString
                txt_length1.Text = dr(31).ToString
                txt_Remarks.Text = dr(34).ToString

                txt_100b_m_remark.Text = dr(34).ToString
                txt_200b_premiseno.Text = dr(35).ToString

                txt_pipesize_length.Text = dr(42).ToString

                chk2lbSystem.Checked = dr(80).ToString
                'chk2lbSystemNo1.Checked = dr(112).ToString
                txtPS_Reading.Text = dr(76).ToString
                cmbRetiredSize.SelectedValue = dr(81).ToString
                txtUnitsRetired.Text = dr(82).ToString
                txtLengthRetired.Text = dr(83).ToString
                txtRetiredQnty.Text = dr(84).ToString

                chk_stub.Checked = dr(36).ToString
                chk_inserted.Checked = dr(37).ToString
                chk_retired.Checked = dr(38).ToString
                ckh_leak.Checked = dr(39).ToString
                chk_split.Checked = dr(40).ToString
                chk_relocate.Checked = dr(71).ToString
                chk_replace.Checked = dr(72).ToString
                cmb_loccd_1.Text = dr(73).ToString
                txt_loccd_2.Text = dr(74).ToString
            End If





            If dr(2).ToString = "Yellow" Then

                txt_y_add1.Text = dr(3).ToString
                If add_streetno <> "" Then
                    txt_y_add1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_y_add1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                cmb_y_add2.Text = dr(4).ToString
                If add_prefix <> "" Then
                    cmb_y_add2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_y_add2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_y_add2_1.Text = dr(5).ToString
                If add_prefix_2 <> "" Then
                    cmb_y_add2_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_y_add2_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_y_add3.Text = dr(6).ToString
                If add_streetname <> "" Then
                    cmb_y_add3.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_y_add3.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_y_add4_1.Text = dr(7).ToString
                If add_suffix <> "" Then
                    cmb_y_add4_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_y_add4_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_y_add4.Text = dr(8).ToString
                If street_suffix_cd <> "" Then
                    cmb_y_add4.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_y_add4.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                'txt_y_name.Text = dr(9).ToString
                txt_y_dated.Text = Format(dr(10), "MM/dd/yyyy").ToString()

                If date_installed <> "" Then
                    txt_y_dated.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_y_dated.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_y_city.Text = dr(11).ToString
                If city <> "" Then
                    cmb_y_city.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_y_city.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_y_subdiv.Text = dr(12).ToString
                If subdivision <> "" Then
                    txt_y_subdiv.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_y_subdiv.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_y_serno.Text = dr(13).ToString
                cmb_y_pipesize.SelectedValue = dr(14).ToString
                If pipe_size <> "" Then

                    cmb_y_pipesize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_y_pipesize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                cmb_y_pipekind.SelectedValue = dr(15).ToString
                If pipe_type <> "" Then

                    cmb_y_pipekind.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_y_pipekind.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_y_pressure.SelectedValue = dr(16).ToString
                If pressure <> "" Then

                    cmb_y_pressure.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_y_pressure.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_y_tapzize.SelectedValue = dr(17).ToString
                If size_of_tap <> "" Then

                    cmb_y_tapzize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_y_tapzize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_y_ser_ft.Text = dr(18).ToString
                If length_main_to_curb_valve_ft = 12345 Then

                    txt_y_ser_ft.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_y_ser_ft.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_y_ser_in.Text = dr(19).ToString
                If length_main_to_curb_valve_in = 12345 Then

                    txt_y_ser_in.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_y_ser_in.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_y_depser_ft.Text = dr(20).ToString
                If length_curb_valve_to_property_line_ft = 12345 Then

                    txt_y_depser_ft.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_y_depser_ft.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_y_depser_in.Text = dr(21).ToString
                If length_curb_valve_to_property_line_in = 12345 Then

                    txt_y_depser_in.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_y_depser_in.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_y_mainln_ft.Text = dr(22).ToString
                If length_main_to_property_line_ft = 12345 Then

                    txt_y_mainln_ft.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_y_mainln_ft.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_y_mainln_in.Text = dr(23).ToString
                If length_main_to_property_line_in = 12345 Then

                    txt_y_mainln_in.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_y_mainln_in.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_y_propln_ft.Text = dr(24).ToString
                If length_property_line_to_meter_ft = 12345 Then

                    txt_y_propln_ft.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_y_propln_ft.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_y_propln_in.Text = dr(25).ToString
                If length_property_line_to_meter_in = 12345 Then

                    txt_y_propln_in.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_y_propln_in.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_y_mainsize.SelectedValue = dr(26).ToString
                If size_of_main <> "" Then

                    cmb_y_mainsize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_y_mainsize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_y_maintype.SelectedValue = dr(27).ToString
                If type_of_main <> "" Then

                    cmb_y_maintype.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_y_maintype.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_y_deptmain.Text = dr(28).ToString
                If depth_of_main <> "" Then

                    txt_y_deptmain.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_y_deptmain.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_y_testedwith.SelectedValue = dr(29).ToString
                If tested_with <> "" Then

                    cmb_y_testedwith.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_y_testedwith.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_y_testedto.SelectedValue = dr(30).ToString
                If tested_to <> "" Then

                    cmb_y_testedto.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_y_testedto.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_y_psigmin.Text = dr(31).ToString
                If psig_for_minutes <> "" Then

                    txt_y_psigmin.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_y_psigmin.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_y_installedby.Text = dr(32).ToString
                If installed_by_contractor <> "" Then

                    txt_y_installedby.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_y_installedby.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_y_foreman.Text = dr(33).ToString
                If foreman <> "" Then

                    txt_y_foreman.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_y_foreman.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_y_remark.Text = dr(34).ToString
                txt_y_premiseno.Text = dr(35).ToString
                If PREMISE_NO <> "" Then

                    txt_y_premiseno.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_y_premiseno.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                chk_stub.Checked = dr(36).ToString

                If f_stub <> "" Then
                    chk_stub.ForeColor = Color.Red
                Else
                    chk_stub.ForeColor = Color.Black
                End If
                chk_inserted.Checked = dr(37).ToString
                If f_inserted <> "" Then
                    chk_inserted.ForeColor = Color.Red
                Else
                    chk_inserted.ForeColor = Color.Black
                End If
                chk_retired.Checked = dr(38).ToString
                If f_retired <> "" Then
                    chk_retired.ForeColor = Color.Red
                Else
                    chk_retired.ForeColor = Color.Black
                End If
                ckh_leak.Checked = dr(39).ToString
                If f_leak <> "" Then
                    ckh_leak.ForeColor = Color.Red
                Else
                    ckh_leak.ForeColor = Color.Black
                End If
                chk_split.Checked = dr(40).ToString
                If f_split <> "" Then
                    chk_split.ForeColor = Color.Red
                Else
                    chk_split.ForeColor = Color.Black
                End If

                cmb_loccd_1.Text = dr(73).ToString
                If STREET_LOCATION_1_CD <> "" Then
                    cmb_loccd_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)

                    cmb_loccd_1.BackColor = Color.Red
                Else
                    cmb_loccd_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                    cmb_loccd_1.BackColor = Color.White
                End If
                txt_loccd_2.Text = dr(74).ToString
                If STREET_LOCATION_2_CD <> "" Then
                    txt_loccd_2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                    txt_loccd_2.BackColor = Color.Red
                Else
                    txt_loccd_2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                    txt_loccd_2.BackColor = Color.White
                End If
            End If

            If dr(2).ToString = "ORIGINAL" Then

                txt_q_add1.Text = dr(3).ToString
                If add_streetno <> "" Then
                    txt_q_add1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_q_add1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_q_add2.Text = dr(4).ToString
                If add_prefix <> "" Then
                    cmb_q_add2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_q_add2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_q_add2_1.Text = dr(5).ToString
                If add_prefix_2 <> "" Then
                    cmb_q_add2_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_q_add2_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_q_add3.Text = dr(6).ToString
                If add_streetname <> "" Then
                    cmb_q_add3.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_q_add3.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_q_add4_1.Text = dr(7).ToString
                If add_suffix <> "" Then
                    cmb_q_add4_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_q_add4_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_q_add4.Text = dr(8).ToString
                If street_suffix_cd <> "" Then
                    cmb_q_add4.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_q_add4.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                txt_q_dated.Text = Format(dr(10), "MM/dd/yyyy").ToString()
                If date_installed <> "" Then
                    txt_q_dated.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_q_dated.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_q_city.Text = dr(11).ToString
                If city <> "" Then
                    cmb_q_city.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_q_city.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                cmb_q_pipesize.SelectedValue = dr(14).ToString
                If pipe_size <> "" Then

                    cmb_q_pipesize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_q_pipesize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_q_pipekind.SelectedValue = dr(15).ToString
                If pipe_type <> "" Then

                    cmb_q_pipekind.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_q_pipekind.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                cmb_q_mainsize.SelectedValue = dr(26).ToString
                If size_of_main <> "" Then

                    cmb_q_mainsize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_q_mainsize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_q_maintype.SelectedValue = dr(27).ToString
                If type_of_main <> "" Then

                    cmb_q_maintype.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_q_maintype.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                cmb_q_testedwith.SelectedValue = dr(29).ToString
                If tested_with <> "" Then

                    cmb_q_testedwith.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_q_testedwith.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_q_testedto.SelectedValue = dr(30).ToString
                If tested_to <> "" Then

                    cmb_q_testedto.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_q_testedto.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_q_psigmin.Text = dr(31).ToString
                If psig_for_minutes <> "" Then

                    txt_q_psigmin.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_q_psigmin.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                txt_q_remark.Text = dr(34).ToString
                txt_q_premiseno.Text = dr(35).ToString
                If PREMISE_NO <> "" Then

                    txt_q_premiseno.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_q_premiseno.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                chk_stub.Checked = dr(36).ToString
                If f_stub <> "" Then
                    chk_stub.ForeColor = Color.Red
                Else
                    chk_stub.ForeColor = Color.Black
                End If
                chk_inserted.Checked = dr(37).ToString
                If f_inserted <> "" Then
                    chk_inserted.ForeColor = Color.Red
                Else
                    chk_inserted.ForeColor = Color.Black
                End If
                chk_retired.Checked = dr(38).ToString
                If f_retired <> "" Then
                    chk_retired.ForeColor = Color.Red
                Else
                    chk_retired.ForeColor = Color.Black
                End If
                ckh_leak.Checked = dr(39).ToString
                If f_leak <> "" Then
                    ckh_leak.ForeColor = Color.Red
                Else
                    ckh_leak.ForeColor = Color.Black
                End If
                chk_split.Checked = dr(40).ToString
                If f_split <> "" Then
                    chk_split.ForeColor = Color.Red
                Else
                    chk_split.ForeColor = Color.Black
                End If
                txt_q_lenmtrtomain.Text = dr(42).ToString
                If lenmtrtomain = 12345 Then

                    txt_q_lenmtrtomain.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_q_lenmtrtomain.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_q_coating.Text = dr(49).ToString
                If type_coating <> "" Then

                    cmb_q_coating.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_q_coating.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                chk_q_noblow.Checked = dr(52).ToString
                If f_noblow <> "" Then

                    chk_q_noblow.ForeColor = Color.Red
                Else
                    chk_q_noblow.ForeColor = Color.Black
                End If


                chk_q_defcoatcor.Checked = dr(56).ToString
                If f_defcoatcor <> "" Then

                    chk_q_defcoatcor.ForeColor = Color.Red
                Else
                    chk_q_defcoatcor.ForeColor = Color.Black
                End If
                chk_q_multimeter.Checked = dr(57).ToString
                If f_multimeter <> "" Then

                    chk_q_multimeter.ForeColor = Color.Red
                Else
                    chk_q_multimeter.ForeColor = Color.Black
                End If

                chk_q_serstop.Checked = dr(58).ToString
                If f_serstop <> "" Then

                    chk_q_serstop.ForeColor = Color.Red
                Else
                    chk_q_serstop.ForeColor = Color.Black
                End If
                chk_q_cathodpro.Checked = dr(59).ToString
                If f_cathodpro <> "" Then

                    chk_q_cathodpro.ForeColor = Color.Red
                Else
                    chk_q_cathodpro.ForeColor = Color.Black
                End If
                chk_q_tee.Checked = dr(60).ToString
                If f_tee <> "" Then

                    chk_q_tee.ForeColor = Color.Red
                Else
                    chk_q_tee.ForeColor = Color.Black
                End If
                chk_q_taptee.Checked = dr(61).ToString
                If f_taptee <> "" Then

                    chk_q_taptee.ForeColor = Color.Red
                Else
                    chk_q_taptee.ForeColor = Color.Black
                End If
                chk_q_galvanized.Checked = dr(62).ToString
                If f_galvanized <> "" Then

                    chk_q_galvanized.ForeColor = Color.Red
                Else
                    chk_q_galvanized.ForeColor = Color.Black
                End If
                txt_q_ttsize.Text = dr(63).ToString
                If tap_t_size <> "" Then

                    txt_q_ttsize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_q_ttsize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_q_ttinlet.Text = dr(64).ToString
                If tap_t_inlet <> "" Then

                    txt_q_ttinlet.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_q_ttinlet.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_q_ttoutlet.Text = dr(65).ToString
                If tap_t_outlet <> "" Then

                    txt_q_ttoutlet.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_q_ttoutlet.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                chk_q_insulated.Checked = dr(66).ToString
                If f_insulated <> "" Then

                    chk_q_insulated.ForeColor = Color.Red
                Else
                    chk_q_insulated.ForeColor = Color.Black
                End If
                chk_q_anoderiser.Checked = dr(67).ToString
                If f_anoderiser <> "" Then

                    chk_q_anoderiser.ForeColor = Color.Red
                Else
                    chk_q_anoderiser.ForeColor = Color.Black
                End If
                txt_q_otheranode.Text = dr(68).ToString
                If otheranode_lbs <> "" Then

                    txt_q_otheranode.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_q_otheranode.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_loccd_1.Text = dr(73).ToString
                If STREET_LOCATION_1_CD <> "" Then
                    cmb_loccd_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)

                    cmb_loccd_1.BackColor = Color.Red
                Else
                    cmb_loccd_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                    cmb_loccd_1.BackColor = Color.White
                End If
                txt_loccd_2.Text = dr(74).ToString
                If STREET_LOCATION_2_CD <> "" Then
                    txt_loccd_2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                    txt_loccd_2.BackColor = Color.Red
                Else
                    txt_loccd_2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                    txt_loccd_2.BackColor = Color.White
                End If
            End If
            If dr(2).ToString = "MISC" Then

                txt_l_add1.Text = dr(3).ToString
                If add_streetno <> "" Then
                    txt_l_add1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_l_add1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_l_add2.Text = dr(4).ToString
                If add_prefix <> "" Then
                    cmb_l_add2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_l_add2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_l_add2_1.Text = dr(5).ToString
                If add_prefix_2 <> "" Then
                    cmb_l_add2_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_l_add2_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_l_add3.Text = dr(6).ToString
                If add_streetname <> "" Then
                    cmb_l_add3.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_l_add3.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_l_add4_1.Text = dr(7).ToString
                If add_suffix <> "" Then
                    cmb_l_add4_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_l_add4_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_l_add4.Text = dr(8).ToString
                If street_suffix_cd <> "" Then
                    cmb_l_add4.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_l_add4.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If


                cmb_l_city.Text = dr(11).ToString

                If city <> "" Then
                    cmb_l_city.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_l_city.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                txt_l_remark.Text = dr(34).ToString
                txt_l_premiseno.Text = dr(35).ToString
                If PREMISE_NO <> "" Then

                    txt_l_premiseno.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_l_premiseno.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                chk_stub.Checked = dr(36).ToString
                If f_stub <> "" Then
                    chk_stub.ForeColor = Color.Red
                Else
                    chk_stub.ForeColor = Color.Black
                End If
                chk_inserted.Checked = dr(37).ToString
                If f_inserted <> "" Then
                    chk_inserted.ForeColor = Color.Red
                Else
                    chk_inserted.ForeColor = Color.Black
                End If
                chk_retired.Checked = dr(38).ToString
                If f_retired <> "" Then
                    chk_retired.ForeColor = Color.Red
                Else
                    chk_retired.ForeColor = Color.Black
                End If
                ckh_leak.Checked = dr(39).ToString
                If f_leak <> "" Then
                    ckh_leak.ForeColor = Color.Red
                Else
                    ckh_leak.ForeColor = Color.Black
                End If
                chk_split.Checked = dr(40).ToString
                If f_split <> "" Then
                    chk_split.ForeColor = Color.Red
                Else
                    chk_split.ForeColor = Color.Black
                End If
                cmb_l_misCtype.Text = dr(70).ToString
                If misc_card_type <> "" Then
                    cmb_l_misCtype.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_l_misCtype.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_loccd_1.Text = dr(73).ToString
                If STREET_LOCATION_1_CD <> "" Then
                    cmb_loccd_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)

                    cmb_loccd_1.BackColor = Color.Red
                Else
                    cmb_loccd_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                    cmb_loccd_1.BackColor = Color.White
                End If
                txt_loccd_2.Text = dr(74).ToString
                If STREET_LOCATION_2_CD <> "" Then
                    txt_loccd_2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                    txt_loccd_2.BackColor = Color.Red
                Else
                    txt_loccd_2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                    txt_loccd_2.BackColor = Color.White
                End If
            End If
            If dr(2).ToString = "ORIGINAL-R" Then

                txt_r_add1.Text = dr(3).ToString
                If add_streetno <> "" Then
                    txt_r_add1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_r_add1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_r_add2.Text = dr(4).ToString
                If add_prefix <> "" Then
                    cmb_r_add2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_r_add2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_r_add2_1.Text = dr(5).ToString
                If add_prefix_2 <> "" Then
                    cmb_r_add2_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_r_add2_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_r_add3.Text = dr(6).ToString
                If add_streetname <> "" Then
                    cmb_r_add3.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_r_add3.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_r_add4_1.Text = dr(7).ToString
                If add_suffix <> "" Then
                    cmb_r_add4_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_r_add4_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_r_add4.Text = dr(8).ToString
                If street_suffix_cd <> "" Then
                    cmb_r_add4.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_r_add4.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_r_dated.Text = Format(dr(10), "MM/dd/yyyy").ToString()
                If date_installed <> "" Then
                    txt_r_dated.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_r_dated.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_r_city.Text = dr(11).ToString
                If city <> "" Then
                    cmb_r_city.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_r_city.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                cmb_r_pipesize.SelectedValue = dr(14).ToString
                If pipe_size <> "" Then

                    cmb_r_pipesize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_r_pipesize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_r_pipekind.SelectedValue = dr(15).ToString
                If pipe_type <> "" Then

                    cmb_r_pipekind.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_r_pipekind.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                cmb_r_mainsize.SelectedValue = dr(26).ToString
                If size_of_main <> "" Then

                    cmb_r_mainsize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_r_mainsize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_r_maintype.SelectedValue = dr(27).ToString
                If type_of_main <> "" Then

                    cmb_r_maintype.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_r_maintype.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                cmb_r_testedwith.SelectedValue = dr(29).ToString
                If tested_with <> "" Then

                    cmb_r_testedwith.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_r_testedwith.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_r_testedto.SelectedValue = dr(30).ToString
                If tested_to <> "" Then

                    cmb_r_testedto.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_r_testedto.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_r_psigmin.Text = dr(31).ToString
                If psig_for_minutes <> "" Then

                    txt_r_psigmin.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_r_psigmin.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                txt_r_remark.Text = dr(34).ToString
                txt_r_premiseno.Text = dr(35).ToString
                If PREMISE_NO <> "" Then

                    txt_r_premiseno.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_r_premiseno.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                chk_stub.Checked = dr(36).ToString
                If f_stub <> "" Then
                    chk_stub.ForeColor = Color.Red
                Else
                    chk_stub.ForeColor = Color.Black
                End If
                chk_inserted.Checked = dr(37).ToString
                If f_inserted <> "" Then
                    chk_inserted.ForeColor = Color.Red
                Else
                    chk_inserted.ForeColor = Color.Black
                End If
                chk_retired.Checked = dr(38).ToString
                If f_retired <> "" Then
                    chk_retired.ForeColor = Color.Red
                Else
                    chk_retired.ForeColor = Color.Black
                End If
                ckh_leak.Checked = dr(39).ToString
                If f_leak <> "" Then
                    ckh_leak.ForeColor = Color.Red
                Else
                    ckh_leak.ForeColor = Color.Black
                End If
                chk_split.Checked = dr(40).ToString
                If f_split <> "" Then
                    chk_split.ForeColor = Color.Red
                Else
                    chk_split.ForeColor = Color.Black
                End If
                txt_r_lenmtrtomain.Text = dr(42).ToString
                If lenmtrtomain = 12345 Then
                    txt_r_lenmtrtomain.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_r_lenmtrtomain.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If


                chk_r_noblow.Checked = dr(52).ToString
                If f_noblow <> "" Then
                    chk_r_noblow.ForeColor = Color.Red
                Else
                    chk_r_noblow.ForeColor = Color.Black
                End If

                chk_r_defcoatcor.Checked = dr(56).ToString
                If f_defcoatcor <> "" Then
                    chk_r_defcoatcor.ForeColor = Color.Red
                Else
                    chk_r_defcoatcor.ForeColor = Color.Black
                End If

                chk_r_serstop.Checked = dr(58).ToString
                If f_serstop <> "" Then
                    chk_r_serstop.ForeColor = Color.Red
                Else
                    chk_r_serstop.ForeColor = Color.Black
                End If
                chk_r_cathodpro.Checked = dr(59).ToString
                If f_cathodpro <> "" Then
                    chk_r_cathodpro.ForeColor = Color.Red
                Else
                    chk_r_cathodpro.ForeColor = Color.Black
                End If

                txt_r_ttsize.Text = dr(63).ToString
                If tap_t_size <> "" Then
                    txt_r_ttsize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_r_ttsize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                txt_r_ttinlet.Text = dr(64).ToString
                If tap_t_inlet <> "" Then
                    txt_r_ttinlet.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_r_ttinlet.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_r_ttoutlet.Text = dr(65).ToString
                If tap_t_outlet <> "" Then
                    txt_r_ttoutlet.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_r_ttoutlet.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                chk_r_insulated.Checked = dr(66).ToString
                If f_insulated <> "" Then
                    chk_r_insulated.ForeColor = Color.Red
                Else
                    chk_r_insulated.ForeColor = Color.Black
                End If
                chk_r_anoderiser.Checked = dr(67).ToString
                If f_anoderiser <> "" Then
                    chk_r_anoderiser.ForeColor = Color.Red
                Else
                    chk_r_anoderiser.ForeColor = Color.Black
                End If
                txt_r_otheranode.Text = dr(68).ToString
                If otheranode_lbs <> "" Then
                    txt_r_otheranode.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_r_otheranode.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_r_connection_data.Text = dr(69).ToString
                If connection_data <> "" Then
                    cmb_r_connection_data.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_r_connection_data.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_loccd_1.Text = dr(73).ToString
                If STREET_LOCATION_1_CD <> "" Then
                    cmb_loccd_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)

                    cmb_loccd_1.BackColor = Color.Red
                Else
                    cmb_loccd_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                    cmb_loccd_1.BackColor = Color.White
                End If
                txt_loccd_2.Text = dr(74).ToString
                If STREET_LOCATION_2_CD <> "" Then
                    txt_loccd_2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                    txt_loccd_2.BackColor = Color.Red
                Else
                    txt_loccd_2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                    txt_loccd_2.BackColor = Color.White
                End If
            End If
            If dr(2).ToString = "ABANDON-II" Then

                txt_a_add1.Text = dr(3).ToString
                If add_streetno <> "" Then
                    txt_a_add1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_a_add1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_a_add2.Text = dr(4).ToString
                If add_prefix <> "" Then
                    cmb_a_add2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_a_add2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_a_add2_1.Text = dr(5).ToString
                If add_prefix_2 <> "" Then
                    cmb_a_add2_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_a_add2_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_a_add3.Text = dr(6).ToString
                If add_streetname <> "" Then
                    cmb_a_add3.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_a_add3.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_a_add4_1.Text = dr(7).ToString
                If add_suffix <> "" Then
                    cmb_a_add4_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_a_add4_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_a_add4.Text = dr(8).ToString
                If street_suffix_cd <> "" Then
                    cmb_a_add4.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_a_add4.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                cmb_a_city.Text = dr(11).ToString
                If city <> "" Then
                    cmb_a_city.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_a_city.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                cmb_a_mainsize.SelectedValue = dr(26).ToString
                If size_of_main <> "" Then

                    cmb_a_mainsize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_a_mainsize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_a_maintype.SelectedValue = dr(27).ToString
                If type_of_main <> "" Then

                    cmb_a_maintype.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_a_maintype.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                cmb_a_testedwith.SelectedValue = dr(29).ToString
                If tested_with <> "" Then

                    cmb_a_testedwith.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_a_testedwith.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                txt_a_installedby.Text = dr(32).ToString
                If installed_by_contractor <> "" Then

                    txt_a_installedby.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_a_installedby.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                txt_a_remark.Text = dr(34).ToString
                txt_a_premiseno.Text = dr(35).ToString
                If PREMISE_NO <> "" Then

                    txt_a_premiseno.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_a_premiseno.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                chk_stub.Checked = dr(36).ToString
                If f_stub <> "" Then
                    chk_stub.ForeColor = Color.Red
                Else
                    chk_stub.ForeColor = Color.Black
                End If
                chk_inserted.Checked = dr(37).ToString
                If f_inserted <> "" Then
                    chk_inserted.ForeColor = Color.Red
                Else
                    chk_inserted.ForeColor = Color.Black
                End If
                chk_retired.Checked = dr(38).ToString
                If f_retired <> "" Then
                    chk_retired.ForeColor = Color.Red
                Else
                    chk_retired.ForeColor = Color.Black
                End If
                ckh_leak.Checked = dr(39).ToString
                If f_leak <> "" Then
                    ckh_leak.ForeColor = Color.Red
                Else
                    ckh_leak.ForeColor = Color.Black
                End If
                chk_split.Checked = dr(40).ToString
                If f_split <> "" Then
                    chk_split.ForeColor = Color.Red
                Else
                    chk_split.ForeColor = Color.Black
                End If
                txt_a_lenmtrtomain.Text = dr(42).ToString
                If lenmtrtomain = 12345 Then
                    txt_a_lenmtrtomain.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_a_lenmtrtomain.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_a_dateabandon.Text = Format(dr(50), "MM/dd/yyyy").ToString()
                If DATE_ABANDON <> "" Then
                    txt_a_dateabandon.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_a_dateabandon.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_a_reasonabandon.SelectedValue = dr(51).ToString
                If reason_of_abandon <> "" Then
                    cmb_a_reasonabandon.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_a_reasonabandon.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                chk_a_noblow.Checked = dr(52).ToString
                If f_noblow <> "" Then
                    chk_a_noblow.ForeColor = Color.Red
                Else
                    chk_a_noblow.ForeColor = Color.Black
                End If
                chk_a_gassource.Checked = dr(53).ToString
                If f_gassource <> "" Then
                    chk_a_gassource.ForeColor = Color.Red
                Else
                    chk_a_gassource.ForeColor = Color.Black
                End If
                chk_a_tappingtee.Checked = dr(54).ToString
                If f_tappingtee <> "" Then
                    chk_a_tappingtee.ForeColor = Color.Red
                Else
                    chk_a_tappingtee.ForeColor = Color.Black
                End If
                chk_a_linesealed.Checked = dr(55).ToString
                If f_linesealed <> "" Then
                    chk_a_linesealed.ForeColor = Color.Red
                Else
                    chk_a_linesealed.ForeColor = Color.Black
                End If
                cmb_loccd_1.Text = dr(73).ToString
                If STREET_LOCATION_1_CD <> "" Then
                    cmb_loccd_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)

                    cmb_loccd_1.BackColor = Color.Red
                Else
                    cmb_loccd_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                    cmb_loccd_1.BackColor = Color.White
                End If
                txt_loccd_2.Text = dr(74).ToString
                If STREET_LOCATION_2_CD <> "" Then
                    txt_loccd_2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                    txt_loccd_2.BackColor = Color.Red
                Else
                    txt_loccd_2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                    txt_loccd_2.BackColor = Color.White
                End If
            End If
            If dr(2).ToString = "Form-X" Then
                'txt_fileid.Text = ""
                'txt_filedesc.Text = ""
                'cmb_formtype.Text = ""
                txt_x_add1.Text = dr(3).ToString
                If add_streetno <> "" Then
                    txt_x_add1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_x_add1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                cmb_x_add2.Text = dr(4).ToString
                If add_prefix <> "" Then
                    cmb_x_add2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_x_add2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_x_add2_1.Text = dr(5).ToString
                If add_prefix_2 <> "" Then
                    cmb_x_add2_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_x_add2_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_x_add3.Text = dr(6).ToString
                If add_streetname <> "" Then
                    cmb_x_add3.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_x_add3.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_x_add4_1.Text = dr(7).ToString
                If add_suffix <> "" Then
                    cmb_x_add4_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_x_add4_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_x_add4.Text = dr(8).ToString
                If street_suffix_cd <> "" Then
                    cmb_x_add4.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_x_add4.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                txt_x_dated.Text = Format(dr(10), "MM/dd/yyyy").ToString()
                If date_installed <> "" Then
                    txt_x_dated.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_x_dated.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_x_city.Text = dr(11).ToString
                If city <> "" Then
                    cmb_x_city.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_x_city.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                cmb_x_pipesize.SelectedValue = dr(14).ToString
                If pipe_size <> "" Then

                    cmb_x_pipesize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_x_pipesize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_x_pipekind.SelectedValue = dr(15).ToString
                If pipe_type <> "" Then

                    cmb_x_pipekind.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_x_pipekind.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_x_mainln_ft.Text = dr(22).ToString
                If length_main_to_property_line_ft = 12345 Then

                    txt_x_mainln_ft.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_x_mainln_ft.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_x_mainln_in.Text = dr(23).ToString
                If length_main_to_property_line_in = 12345 Then

                    txt_x_mainln_in.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_x_mainln_in.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_x_propln_ft.Text = dr(24).ToString
                If length_property_line_to_meter_ft = 12345 Then

                    txt_x_propln_ft.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_x_propln_ft.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_x_propln_in.Text = dr(25).ToString
                If length_property_line_to_meter_in = 12345 Then

                    txt_x_propln_in.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_x_propln_in.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_x_mainsize.SelectedValue = dr(26).ToString
                If size_of_main <> "" Then

                    cmb_x_mainsize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_x_mainsize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_x_maintype.SelectedValue = dr(27).ToString
                If type_of_main <> "" Then

                    cmb_x_maintype.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_x_maintype.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                cmb_x_testedwith.SelectedValue = dr(29).ToString
                If tested_with <> "" Then

                    cmb_x_testedwith.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_x_testedwith.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_x_testedto.SelectedValue = dr(30).ToString
                If tested_to <> "" Then

                    cmb_x_testedto.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_x_testedto.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                txt_x_installedby.Text = dr(32).ToString
                If installed_by_contractor <> "" Then

                    txt_x_installedby.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_x_installedby.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                txt_x_remark.Text = dr(34).ToString
                txt_x_premiseno.Text = dr(35).ToString
                If PREMISE_NO <> "" Then

                    txt_x_premiseno.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_x_premiseno.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                chk_stub.Checked = dr(36).ToString
                If f_stub <> "" Then
                    chk_stub.ForeColor = Color.Red
                Else
                    chk_stub.ForeColor = Color.Black
                End If
                chk_inserted.Checked = dr(37).ToString
                If f_inserted <> "" Then
                    chk_inserted.ForeColor = Color.Red
                Else
                    chk_inserted.ForeColor = Color.Black
                End If
                chk_retired.Checked = dr(38).ToString
                If f_retired <> "" Then
                    chk_retired.ForeColor = Color.Red
                Else
                    chk_retired.ForeColor = Color.Black
                End If
                ckh_leak.Checked = dr(39).ToString
                If f_leak <> "" Then
                    ckh_leak.ForeColor = Color.Red
                Else
                    ckh_leak.ForeColor = Color.Black
                End If
                chk_split.Checked = dr(40).ToString
                If f_split <> "" Then
                    chk_split.ForeColor = Color.Red
                Else
                    chk_split.ForeColor = Color.Black
                End If
                txt_x_lenmtrtomain.Text = dr(42).ToString
                If lenmtrtomain = 12345 Then
                    txt_x_lenmtrtomain.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_x_lenmtrtomain.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_x_coating.Text = dr(49).ToString
                If type_coating <> "" Then
                    cmb_x_coating.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_x_coating.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_loccd_1.Text = dr(73).ToString
                If STREET_LOCATION_1_CD <> "" Then
                    cmb_loccd_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)

                    cmb_loccd_1.BackColor = Color.Red
                Else
                    cmb_loccd_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                    cmb_loccd_1.BackColor = Color.White
                End If
                txt_loccd_2.Text = dr(74).ToString
                If STREET_LOCATION_2_CD <> "" Then
                    txt_loccd_2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                    txt_loccd_2.BackColor = Color.Red
                Else
                    txt_loccd_2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                    txt_loccd_2.BackColor = Color.White
                End If
            End If
            If dr(2).ToString = "FORM-IX" Then

                txt_9_add1.Text = dr(3).ToString
                If add_streetno <> "" Then
                    txt_9_add1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_9_add1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_9_add2.Text = dr(4).ToString
                If add_prefix <> "" Then
                    cmb_9_add2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_9_add2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                cmb_9_add2_1.Text = dr(5).ToString
                If add_prefix_2 <> "" Then
                    cmb_9_add2_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_9_add2_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_9_add3.Text = dr(6).ToString
                If add_streetname <> "" Then
                    cmb_9_add3.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_9_add3.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_9_add4_1.Text = dr(7).ToString
                If add_suffix <> "" Then
                    cmb_9_add4_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_9_add4_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_9_add4.Text = dr(8).ToString
                If street_suffix_cd <> "" Then
                    cmb_9_add4.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_9_add4.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                txt_9_dated.Text = Format(dr(10), "MM/dd/yyyy").ToString()
                If date_installed <> "" Then
                    txt_9_dated.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_9_dated.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_9_city.Text = dr(11).ToString
                If city <> "" Then
                    cmb_9_city.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_9_city.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                txt_9_serno.Text = dr(13).ToString
                cmb_9_pipesize.SelectedValue = dr(14).ToString
                If pipe_size <> "" Then

                    cmb_9_pipesize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_9_pipesize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_9_pipekind.SelectedValue = dr(15).ToString
                If pipe_type <> "" Then

                    cmb_9_pipekind.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_9_pipekind.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                cmb_9_tapzize.SelectedValue = dr(17).ToString
                If size_of_tap <> "" Then

                    cmb_9_tapzize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_9_tapzize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                cmb_9_mainsize.SelectedValue = dr(26).ToString
                If size_of_main <> "" Then

                    cmb_9_mainsize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_9_mainsize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_9_maintype.SelectedValue = dr(27).ToString
                If type_of_main <> "" Then

                    cmb_9_maintype.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_9_maintype.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                txt_9_foreman.Text = dr(33).ToString
                If foreman <> "" Then

                    txt_9_foreman.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_9_foreman.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_9_remark.Text = dr(34).ToString
                txt_9_premiseno.Text = dr(35).ToString
                If PREMISE_NO <> "" Then

                    txt_9_premiseno.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_9_premiseno.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                chk_stub.Checked = dr(36).ToString
                If f_stub <> "" Then
                    chk_stub.ForeColor = Color.Red
                Else
                    chk_stub.ForeColor = Color.Black
                End If
                chk_inserted.Checked = dr(37).ToString
                If f_inserted <> "" Then
                    chk_inserted.ForeColor = Color.Red
                Else
                    chk_inserted.ForeColor = Color.Black
                End If
                chk_retired.Checked = dr(38).ToString
                If f_retired <> "" Then
                    chk_retired.ForeColor = Color.Red
                Else
                    chk_retired.ForeColor = Color.Black
                End If
                ckh_leak.Checked = dr(39).ToString
                If f_leak <> "" Then
                    ckh_leak.ForeColor = Color.Red
                Else
                    ckh_leak.ForeColor = Color.Black
                End If
                chk_split.Checked = dr(40).ToString
                If f_split <> "" Then
                    chk_split.ForeColor = Color.Red
                Else
                    chk_split.ForeColor = Color.Black
                End If
                txt_9_lenmtrtomain.Text = dr(42).ToString
                If lenmtrtomain = 12345 Then
                    txt_9_lenmtrtomain.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_9_lenmtrtomain.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_9_coating.Text = dr(49).ToString
                If type_coating <> "" Then
                    cmb_9_coating.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_9_coating.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_loccd_1.Text = dr(73).ToString
                If STREET_LOCATION_1_CD <> "" Then
                    cmb_loccd_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                    cmb_loccd_1.BackColor = Color.Red
                Else
                    cmb_loccd_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                    cmb_loccd_1.BackColor = Color.White
                End If
                txt_loccd_2.Text = dr(74).ToString
                If STREET_LOCATION_2_CD <> "" Then
                    txt_loccd_2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                    txt_loccd_2.BackColor = Color.Red
                Else
                    txt_loccd_2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                    txt_loccd_2.BackColor = Color.White
                End If
            End If
            If cmb_formtype.Text.Trim = "Form-954" Then
                txt_7_add1.Text = dr(3).ToString
                If add_streetno <> "" Then
                    txt_7_add1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_7_add1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_7_add2.Text = dr(4).ToString
                If add_prefix <> "" Then
                    cmb_7_add2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_7_add2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_7_add2_1.Text = dr(5).ToString
                If add_prefix_2 <> "" Then
                    cmb_7_add2_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_7_add2_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_7_add3.Text = dr(6).ToString
                If add_streetname <> "" Then
                    cmb_7_add3.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_7_add3.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_7_add4_1.Text = dr(7).ToString
                If add_suffix <> "" Then
                    cmb_7_add4_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_7_add4_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_7_add4.Text = dr(8).ToString
                If street_suffix_cd <> "" Then
                    cmb_7_add4.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_7_add4.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                txt_7_dated.Text = Format(dr(10), "MM/dd/yyyy").ToString()
                If date_installed <> "" Then
                    txt_7_dated.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_7_dated.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_7_city.Text = dr(11).ToString
                If city <> "" Then
                    cmb_7_city.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_7_city.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                cmb_7_pipesize.SelectedValue = dr(14).ToString
                If pipe_size <> "" Then

                    cmb_7_pipesize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_7_pipesize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_7_pipekind.SelectedValue = dr(15).ToString
                If pipe_type <> "" Then

                    cmb_7_pipekind.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_7_pipekind.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                cmb_7_tapzize.SelectedValue = dr(17).ToString
                If size_of_tap <> "" Then

                    cmb_7_tapzize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_7_tapzize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                txt_7_mainln_ft.Text = dr(22).ToString
                If length_main_to_property_line_ft = 12345 Then

                    txt_7_mainln_ft.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_7_mainln_ft.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_7_mainln_in.Text = dr(23).ToString
                If length_main_to_property_line_in = 12345 Then

                    txt_7_mainln_in.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_7_mainln_in.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                cmb_7_mainsize.SelectedValue = dr(26).ToString
                If size_of_main <> "" Then

                    cmb_7_mainsize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_7_mainsize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_7_maintype.SelectedValue = dr(27).ToString
                If type_of_main <> "" Then

                    cmb_7_maintype.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_7_maintype.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                txt_7_remark.Text = dr(34).ToString
                txt_7_premiseno.Text = dr(35).ToString
                If PREMISE_NO <> "" Then

                    txt_7_premiseno.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_7_premiseno.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                chk_stub.Checked = dr(36).ToString
                If f_stub <> "" Then
                    chk_stub.ForeColor = Color.Red
                Else
                    chk_stub.ForeColor = Color.Black
                End If
                chk_inserted.Checked = dr(37).ToString
                If f_inserted <> "" Then
                    chk_inserted.ForeColor = Color.Red
                Else
                    chk_inserted.ForeColor = Color.Black
                End If
                chk_retired.Checked = dr(38).ToString
                If f_retired <> "" Then
                    chk_retired.ForeColor = Color.Red
                Else
                    chk_retired.ForeColor = Color.Black
                End If
                ckh_leak.Checked = dr(39).ToString
                If f_leak <> "" Then
                    ckh_leak.ForeColor = Color.Red
                Else
                    ckh_leak.ForeColor = Color.Black
                End If
                chk_split.Checked = dr(40).ToString
                If f_split <> "" Then
                    chk_split.ForeColor = Color.Red
                Else
                    chk_split.ForeColor = Color.Black
                End If
                txt_7_lenmtrtomain.Text = dr(42).ToString
                If lenmtrtomain = 12345 Then
                    txt_7_lenmtrtomain.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_7_lenmtrtomain.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_7_naturework.SelectedValue = dr(44).ToString
                If nature_of_work <> "" Then
                    cmb_7_naturework.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_7_naturework.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_7_kindjoint.SelectedValue = dr(45).ToString
                If kind_of_joint <> "" Then
                    cmb_7_kindjoint.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_7_kindjoint.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_7_splitsleeve.Text = dr(46).ToString
                If split_sleeve <> "" Then
                    txt_7_splitsleeve.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_7_splitsleeve.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_7_loccock.Text = dr(47).ToString
                If loc_of_cock <> "" Then
                    txt_7_loccock.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_7_loccock.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_7_kindbox.Text = dr(48).ToString
                If kind_of_box <> "" Then
                    txt_7_kindbox.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_7_kindbox.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_7_coating.Text = dr(49).ToString
                If type_coating <> "" Then
                    cmb_7_coating.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_7_coating.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_loccd_1.Text = dr(73).ToString
                If STREET_LOCATION_1_CD <> "" Then
                    cmb_loccd_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                    cmb_loccd_1.BackColor = Color.Red
                Else
                    cmb_loccd_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                    cmb_loccd_1.BackColor = Color.White
                End If
                txt_loccd_2.Text = dr(74).ToString
                If STREET_LOCATION_2_CD <> "" Then
                    txt_loccd_2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                    txt_loccd_2.BackColor = Color.Red
                Else
                    txt_loccd_2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                    txt_loccd_2.BackColor = Color.White
                End If
            End If
            If cmb_formtype.Text.Trim = "ABANDON-I" Then
                txt_8_add1.Text = dr(3).ToString
                If add_streetno <> "" Then
                    txt_8_add1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_8_add1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                cmb_8_add2.Text = dr(4).ToString
                If add_prefix <> "" Then
                    cmb_8_add2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_8_add2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_8_add2_1.Text = dr(5).ToString
                If add_prefix_2 <> "" Then
                    cmb_8_add2_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_8_add2_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_8_add3.Text = dr(6).ToString
                If add_streetname <> "" Then
                    cmb_8_add3.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_8_add3.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_8_add4_1.Text = dr(7).ToString
                If add_suffix <> "" Then
                    cmb_8_add4_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_8_add4_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_8_add4.Text = dr(8).ToString
                If street_suffix_cd <> "" Then
                    cmb_8_add4.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_8_add4.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                txt_8_dated.Text = Format(dr(10), "MM/dd/yyyy").ToString()
                If date_installed <> "" Then
                    txt_8_dated.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_8_dated.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_8_city.Text = dr(11).ToString
                If city <> "" Then
                    cmb_8_city.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_8_city.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                cmb_8_mainsize.SelectedValue = dr(26).ToString
                If size_of_main <> "" Then

                    cmb_8_mainsize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_8_mainsize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_8_maintype.SelectedValue = dr(27).ToString
                If type_of_main <> "" Then

                    cmb_8_maintype.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_8_maintype.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                chk_stub.Checked = dr(36).ToString
                If f_stub <> "" Then
                    chk_stub.ForeColor = Color.Red
                Else
                    chk_stub.ForeColor = Color.Black
                End If
                chk_inserted.Checked = dr(37).ToString
                If f_inserted <> "" Then
                    chk_inserted.ForeColor = Color.Red
                Else
                    chk_inserted.ForeColor = Color.Black
                End If
                chk_retired.Checked = dr(38).ToString
                If f_retired <> "" Then
                    chk_retired.ForeColor = Color.Red
                Else
                    chk_retired.ForeColor = Color.Black
                End If
                ckh_leak.Checked = dr(39).ToString
                If f_leak <> "" Then
                    ckh_leak.ForeColor = Color.Red
                Else
                    ckh_leak.ForeColor = Color.Black
                End If
                chk_split.Checked = dr(40).ToString
                If f_split <> "" Then
                    chk_split.ForeColor = Color.Red
                Else
                    chk_split.ForeColor = Color.Black
                End If

                txt_8_remark.Text = dr(34).ToString
                txt_8_premiseno.Text = dr(35).ToString
                If PREMISE_NO <> "" Then

                    txt_8_premiseno.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_8_premiseno.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                cmb_8_coating.SelectedValue = dr(49).ToString
                If type_coating <> "" Then

                    cmb_8_coating.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_8_coating.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_8_dateabandon.Text = Format(dr(50), "MM/dd/yyyy").ToString()
                If DATE_ABANDON <> "" Then

                    txt_8_dateabandon.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_8_dateabandon.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                cmb_loccd_1.Text = dr(73).ToString
                If STREET_LOCATION_1_CD <> "" Then
                    cmb_loccd_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                    cmb_loccd_1.BackColor = Color.Red
                Else
                    cmb_loccd_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                    cmb_loccd_1.BackColor = Color.White
                End If
                txt_loccd_2.Text = dr(74).ToString
                If STREET_LOCATION_2_CD <> "" Then
                    txt_loccd_2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                    txt_loccd_2.BackColor = Color.Red
                Else
                    txt_loccd_2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                    txt_loccd_2.BackColor = Color.White
                End If
            End If
            If dr(2).ToString = "Form-80I" Then
                'txt_fileid.Text = ""
                'txt_filedesc.Text = ""
                'cmb_formtype.Text = ""
                txt_6_add1.Text = dr(3).ToString
                If add_streetno <> "" Then
                    txt_6_add1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_6_add1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                cmb_6_add2.Text = dr(4).ToString
                If add_prefix <> "" Then
                    cmb_6_add2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_6_add2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_6_add2_1.Text = dr(5).ToString
                If add_prefix_2 <> "" Then
                    cmb_6_add2_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_6_add2_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_6_add3.Text = dr(6).ToString
                If add_streetname <> "" Then
                    cmb_6_add3.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_6_add3.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_6_add4_1.Text = dr(7).ToString
                If add_suffix <> "" Then
                    cmb_6_add4_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_6_add4_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_6_add4.Text = dr(8).ToString
                If street_suffix_cd <> "" Then
                    cmb_6_add4.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_6_add4.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                txt_6_dated.Text = Format(dr(10), "MM/dd/yyyy").ToString()
                If date_installed <> "" Then
                    txt_6_dated.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_6_dated.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_6_city.Text = dr(11).ToString
                If city <> "" Then
                    cmb_6_city.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_6_city.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If


                cmb_6_pipesize.SelectedValue = dr(14).ToString
                If pipe_size <> "" Then
                    cmb_6_pipesize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_6_pipesize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                cmb_6_pipekind.SelectedValue = dr(15).ToString
                If pipe_type <> "" Then
                    cmb_6_pipekind.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_6_pipekind.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                txt_6_ser_ft.Text = dr(18).ToString
                If length_main_to_curb_valve_ft = 12345 Then
                    txt_6_ser_ft.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_6_ser_ft.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_6_ser_in.Text = dr(19).ToString
                If length_main_to_curb_valve_in = 12345 Then
                    txt_6_ser_in.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_6_ser_in.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_6_depser_ft.Text = dr(20).ToString
                If length_curb_valve_to_property_line_ft = 12345 Then
                    txt_6_depser_ft.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_6_depser_ft.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_6_depser_in.Text = dr(21).ToString
                If length_curb_valve_to_property_line_in = 12345 Then
                    txt_6_depser_in.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_6_depser_in.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                cmb_6_mainsize.SelectedValue = dr(26).ToString
                If size_of_main <> "" Then

                    cmb_6_mainsize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_6_mainsize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_6_maintype.SelectedValue = dr(27).ToString
                If type_of_main <> "" Then

                    cmb_6_maintype.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_6_maintype.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_6_deptmain.Text = dr(28).ToString
                If depth_of_main <> "" Then

                    txt_6_deptmain.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_6_deptmain.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_6_testedwith.SelectedValue = dr(29).ToString
                If tested_with <> "" Then

                    cmb_6_testedwith.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_6_testedwith.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_6_testedto.SelectedValue = dr(30).ToString
                If tested_to <> "" Then

                    cmb_6_testedto.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_6_testedto.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_6_psigmin.Text = dr(31).ToString
                If psig_for_minutes <> "" Then

                    txt_6_psigmin.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_6_psigmin.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                txt_6_remark.Text = dr(34).ToString
                txt_6_premiseno.Text = dr(35).ToString
                If PREMISE_NO <> "" Then

                    txt_6_premiseno.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_6_premiseno.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                chk_stub.Checked = dr(36).ToString
                If f_stub <> "" Then
                    chk_stub.ForeColor = Color.Red
                Else
                    chk_stub.ForeColor = Color.Black
                End If
                chk_inserted.Checked = dr(37).ToString
                If f_inserted <> "" Then
                    chk_inserted.ForeColor = Color.Red
                Else
                    chk_inserted.ForeColor = Color.Black
                End If
                chk_retired.Checked = dr(38).ToString
                If f_retired <> "" Then
                    chk_retired.ForeColor = Color.Red
                Else
                    chk_retired.ForeColor = Color.Black
                End If
                ckh_leak.Checked = dr(39).ToString
                If f_leak <> "" Then
                    ckh_leak.ForeColor = Color.Red
                Else
                    ckh_leak.ForeColor = Color.Black
                End If
                chk_split.Checked = dr(40).ToString
                If f_split <> "" Then
                    chk_split.ForeColor = Color.Red
                Else
                    chk_split.ForeColor = Color.Black
                End If
                txt_6_lenmtrtomain.Text = dr(42).ToString
                If lenmtrtomain = 12345 Then
                    txt_6_lenmtrtomain.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_6_lenmtrtomain.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                cmb_loccd_1.Text = dr(73).ToString
                If STREET_LOCATION_1_CD <> "" Then
                    cmb_loccd_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                    cmb_loccd_1.BackColor = Color.Red
                Else
                    cmb_loccd_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                    cmb_loccd_1.BackColor = Color.White
                End If
                txt_loccd_2.Text = dr(74).ToString
                If STREET_LOCATION_2_CD <> "" Then
                    txt_loccd_2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                    txt_loccd_2.BackColor = Color.Red
                Else
                    txt_loccd_2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                    txt_loccd_2.BackColor = Color.White
                End If
            End If
            If dr(2).ToString = "OD-9-6-38" Then
                'txt_fileid.Text = ""
                'txt_filedesc.Text = ""
                'cmb_formtype.Text = ""
                txt_5_add1.Text = dr(3).ToString
                If add_streetno <> "" Then
                    txt_5_add1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_5_add1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                cmb_5_add2.Text = dr(4).ToString
                If add_prefix <> "" Then
                    cmb_5_add2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_5_add2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_5_add2_1.Text = dr(5).ToString
                If add_prefix_2 <> "" Then
                    cmb_5_add2_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_5_add2_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_5_add3.Text = dr(6).ToString
                If add_streetname <> "" Then
                    cmb_5_add3.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_5_add3.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_5_add4_1.Text = dr(7).ToString
                If add_suffix <> "" Then
                    cmb_5_add4_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_5_add4_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_5_add4.Text = dr(8).ToString
                If street_suffix_cd <> "" Then
                    cmb_5_add4.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_5_add4.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                txt_5_dated.Text = Format(dr(10), "MM/dd/yyyy").ToString()
                If date_installed <> "" Then
                    txt_5_dated.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_5_dated.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_5_city.Text = dr(11).ToString
                If city <> "" Then
                    cmb_5_city.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_5_city.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                txt_5_serno.Text = dr(13).ToString
                cmb_5_pipesize.SelectedValue = dr(14).ToString
                If pipe_size <> "" Then

                    cmb_5_pipesize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_5_pipesize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_5_pipekind.SelectedValue = dr(15).ToString
                If pipe_type <> "" Then

                    cmb_5_pipekind.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_5_pipekind.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                txt_5_ser_ft.Text = dr(18).ToString
                If length_main_to_curb_valve_ft = 12345 Then

                    txt_5_ser_ft.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_5_ser_ft.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                txt_5_depser_ft.Text = dr(20).ToString
                If length_curb_valve_to_property_line_ft = 12345 Then

                    txt_5_depser_ft.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_5_depser_ft.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                txt_5_propln_ft.Text = dr(24).ToString
                If length_property_line_to_meter_ft = 12345 Then

                    txt_5_depser_ft.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_5_depser_ft.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                txt_5_remark.Text = dr(34).ToString
                txt_5_premiseno.Text = dr(35).ToString
                If PREMISE_NO <> "" Then

                    txt_5_premiseno.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_5_premiseno.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                chk_stub.Checked = dr(36).ToString
                If f_stub <> "" Then
                    chk_stub.ForeColor = Color.Red
                Else
                    chk_stub.ForeColor = Color.Black
                End If
                chk_inserted.Checked = dr(37).ToString
                If f_inserted <> "" Then
                    chk_inserted.ForeColor = Color.Red
                Else
                    chk_inserted.ForeColor = Color.Black
                End If
                chk_retired.Checked = dr(38).ToString
                If f_retired <> "" Then
                    chk_retired.ForeColor = Color.Red
                Else
                    chk_retired.ForeColor = Color.Black
                End If
                ckh_leak.Checked = dr(39).ToString
                If f_leak <> "" Then
                    ckh_leak.ForeColor = Color.Red
                Else
                    ckh_leak.ForeColor = Color.Black
                End If
                chk_split.Checked = dr(40).ToString
                If f_split <> "" Then
                    chk_split.ForeColor = Color.Red
                Else
                    chk_split.ForeColor = Color.Black
                End If
                cmb_loccd_1.Text = dr(73).ToString
                If STREET_LOCATION_1_CD <> "" Then
                    cmb_loccd_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                    cmb_loccd_1.BackColor = Color.Red

                Else
                    cmb_loccd_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                    cmb_loccd_1.BackColor = Color.White
                End If
                txt_loccd_2.Text = dr(74).ToString
                If STREET_LOCATION_2_CD <> "" Then
                    txt_loccd_2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                    txt_loccd_2.BackColor = Color.Red

                Else
                    txt_loccd_2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                    txt_loccd_2.BackColor = Color.White
                End If
            End If
            If dr(2).ToString = "Form235-B-702" Then
                'txt_fileid.Text = ""
                'txt_filedesc.Text = ""
                'cmb_formtype.Text = ""
                txt_4_add1.Text = dr(3).ToString
                If add_streetno <> "" Then
                    txt_4_add1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_4_add1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                cmb_4_add2.Text = dr(4).ToString
                If add_prefix <> "" Then
                    cmb_4_add2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_4_add2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_4_add2_1.Text = dr(5).ToString
                If add_prefix_2 <> "" Then
                    cmb_4_add2_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_4_add2_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_4_add3.Text = dr(6).ToString
                If add_streetname <> "" Then
                    cmb_4_add3.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_4_add3.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_4_add4_1.Text = dr(7).ToString
                If add_suffix <> "" Then
                    cmb_4_add4_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_4_add4_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_4_add4.Text = dr(8).ToString
                If street_suffix_cd <> "" Then
                    cmb_4_add4.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_4_add4.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                ' txt_4_name.Text = dr(9).ToString
                txt_4_dated.Text = Format(dr(10), "MM/dd/yyyy").ToString()
                If date_installed <> "" Then
                    txt_4_dated.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_4_dated.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_4_city.Text = dr(11).ToString
                If city <> "" Then
                    cmb_4_city.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_4_city.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                cmb_4_pipesize.SelectedValue = dr(14).ToString
                If pipe_size <> "" Then

                    cmb_4_pipesize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_4_pipesize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_4_pipekind.SelectedValue = dr(15).ToString
                If pipe_type <> "" Then

                    cmb_4_pipekind.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_4_pipekind.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                cmb_4_pressure.SelectedValue = dr(16).ToString
                If pressure <> "" Then

                    cmb_4_pressure.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_4_pressure.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                cmb_4_mainsize.SelectedValue = dr(26).ToString
                If size_of_main <> "" Then

                    cmb_4_mainsize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_4_mainsize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_4_maintype.SelectedValue = dr(27).ToString
                If type_of_main <> "" Then

                    cmb_4_maintype.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_4_maintype.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_4_deptmain.Text = dr(28).ToString
                If depth_of_main <> "" Then

                    txt_4_deptmain.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_4_deptmain.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_4_testedwith.SelectedValue = dr(29).ToString
                If tested_with <> "" Then

                    cmb_4_testedwith.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_4_testedwith.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_4_testedto.SelectedValue = dr(30).ToString
                If tested_to <> "" Then

                    cmb_4_testedto.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_4_testedto.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_4_psigmin.Text = dr(31).ToString
                If psig_for_minutes <> "" Then

                    txt_4_psigmin.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_4_psigmin.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_4_installedby.Text = dr(32).ToString
                If installed_by_contractor <> "" Then

                    txt_4_installedby.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_4_installedby.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_4_foreman.Text = dr(33).ToString
                If foreman <> "" Then

                    txt_4_foreman.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_4_foreman.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_4_remark.Text = dr(34).ToString
                txt_4_premiseno.Text = dr(35).ToString
                If PREMISE_NO <> "" Then

                    txt_4_premiseno.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_4_premiseno.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                chk_stub.Checked = dr(36).ToString
                If f_stub <> "" Then
                    chk_stub.ForeColor = Color.Red
                Else
                    chk_stub.ForeColor = Color.Black
                End If
                chk_inserted.Checked = dr(37).ToString
                If f_inserted <> "" Then
                    chk_inserted.ForeColor = Color.Red
                Else
                    chk_inserted.ForeColor = Color.Black
                End If
                chk_retired.Checked = dr(38).ToString
                If f_retired <> "" Then
                    chk_retired.ForeColor = Color.Red
                Else
                    chk_retired.ForeColor = Color.Black
                End If
                ckh_leak.Checked = dr(39).ToString
                If f_leak <> "" Then
                    ckh_leak.ForeColor = Color.Red
                Else
                    ckh_leak.ForeColor = Color.Black
                End If
                chk_split.Checked = dr(40).ToString
                If f_split <> "" Then
                    chk_split.ForeColor = Color.Red
                Else
                    chk_split.ForeColor = Color.Black
                End If

                cmb_4_condition.Text = dr(41).ToString
                If pipe_condition <> "" Then
                    cmb_4_condition.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_4_condition.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_4_lenmtrtomain.Text = dr(42).ToString
                If lenmtrtomain = 12345 Then
                    txt_4_lenmtrtomain.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_4_lenmtrtomain.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_4_sceginspect.Text = dr(43).ToString
                cmb_loccd_1.Text = dr(73).ToString
                If STREET_LOCATION_1_CD <> "" Then
                    cmb_loccd_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                    cmb_loccd_1.BackColor = Color.Red

                Else
                    cmb_loccd_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                    cmb_loccd_1.BackColor = Color.White

                End If
                txt_loccd_2.Text = dr(74).ToString
                If STREET_LOCATION_2_CD <> "" Then
                    txt_loccd_2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                    txt_loccd_2.BackColor = Color.Red

                Else
                    txt_loccd_2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                    txt_loccd_2.BackColor = Color.White
                End If
            End If
            If dr(2).ToString = "Orange" Then
                'txt_fileid.Text = ""
                'txt_filedesc.Text = ""
                'cmb_formtype.Text = ""
                txt_3_add1.Text = dr(3).ToString
                If add_streetno <> "" Then
                    txt_3_add1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_3_add1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                cmb_3_add2.Text = dr(4).ToString
                If add_prefix <> "" Then
                    cmb_3_add2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_3_add2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_3_add2_1.Text = dr(5).ToString
                If add_prefix_2 <> "" Then
                    cmb_3_add2_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_3_add2_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_3_add3.Text = dr(6).ToString
                If add_streetname <> "" Then
                    cmb_3_add3.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_3_add3.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_3_add4_1.Text = dr(7).ToString
                If add_suffix <> "" Then
                    cmb_3_add4_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_3_add4_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_3_add4.Text = dr(8).ToString
                If street_suffix_cd <> "" Then
                    cmb_3_add4.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_3_add4.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                'txt_3_name.Text = dr(9).ToString
                txt_3_dated.Text = Format(dr(10), "MM/dd/yyyy").ToString()
                If date_installed <> "" Then
                    txt_3_dated.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_3_dated.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_3_city.Text = dr(11).ToString
                If city <> "" Then
                    cmb_3_city.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_3_city.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                'txt_3_subdiv.Text = dr(12).ToString
                txt_3_serno.Text = dr(13).ToString
                cmb_3_pipesize.SelectedValue = dr(14).ToString

                If pipe_size <> "" Then

                    cmb_3_pipesize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_3_pipesize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_3_pipekind.SelectedValue = dr(15).ToString
                If pipe_type <> "" Then

                    cmb_3_pipekind.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_3_pipekind.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_3_pressure.SelectedValue = dr(16).ToString
                If pressure <> "" Then

                    cmb_3_pressure.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_3_pressure.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_3_tapzize.SelectedValue = dr(17).ToString
                If size_of_tap <> "" Then

                    cmb_3_tapzize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_3_tapzize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                txt_3_ser_ft.Text = dr(18).ToString
                If length_main_to_curb_valve_ft = 12345 Then

                    txt_3_ser_ft.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_3_ser_ft.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                'txt_3_ser_in.Text = dr(19).ToString
                txt_3_depser_ft.Text = dr(20).ToString
                If length_curb_valve_to_property_line_ft = 12345 Then

                    txt_3_depser_ft.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_3_depser_ft.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                'txt_3_depser_in.Text = dr(21).ToString
                txt_3_mainln_ft.Text = dr(22).ToString
                If length_main_to_property_line_ft = 12345 Then

                    txt_3_mainln_ft.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_3_mainln_ft.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                'txt_3_mainln_in.Text = dr(23).ToString
                txt_3_propln_ft.Text = dr(24).ToString
                If length_property_line_to_meter_ft = 12345 Then

                    txt_3_propln_ft.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_3_propln_ft.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                'txt_3_propln_in.Text = dr(25).ToString
                cmb_3_mainsize.SelectedValue = dr(26).ToString
                If size_of_main <> "" Then

                    cmb_3_mainsize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_3_mainsize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_3_maintype.SelectedValue = dr(27).ToString
                If type_of_main <> "" Then

                    cmb_3_maintype.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_3_maintype.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                'txt_3_deptmain.Text = dr(28).ToString
                'cmb_3_testedwith.SelectedValue = dr(29).ToString
                'cmb_3_testedto.SelectedValue = dr(30).ToString
                'txt_3_psigmin.Text = dr(31).ToString
                txt_3_installedby.Text = dr(32).ToString
                If installed_by_contractor <> "" Then

                    txt_3_installedby.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_3_installedby.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                'txt_3_foreman.Text = dr(33).ToString
                txt_3_remark.Text = dr(34).ToString
                txt_3_premiseno.Text = dr(35).ToString
                If PREMISE_NO <> "" Then

                    txt_3_premiseno.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_3_premiseno.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                chk_stub.Checked = dr(36).ToString
                If f_stub <> "" Then
                    chk_stub.ForeColor = Color.Red
                Else
                    chk_stub.ForeColor = Color.Black
                End If
                chk_inserted.Checked = dr(37).ToString
                If f_inserted <> "" Then
                    chk_inserted.ForeColor = Color.Red
                Else
                    chk_inserted.ForeColor = Color.Black
                End If
                chk_retired.Checked = dr(38).ToString
                If f_retired <> "" Then
                    chk_retired.ForeColor = Color.Red
                Else
                    chk_retired.ForeColor = Color.Black
                End If
                ckh_leak.Checked = dr(39).ToString
                If f_leak <> "" Then
                    ckh_leak.ForeColor = Color.Red
                Else
                    ckh_leak.ForeColor = Color.Black
                End If
                chk_split.Checked = dr(40).ToString
                If f_split <> "" Then
                    chk_split.ForeColor = Color.Red
                Else
                    chk_split.ForeColor = Color.Black
                End If
                cmb_loccd_1.Text = dr(73).ToString
                If STREET_LOCATION_1_CD <> "" Then
                    cmb_loccd_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                    cmb_loccd_1.BackColor = Color.Red

                Else
                    cmb_loccd_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                    cmb_loccd_1.BackColor = Color.White

                End If
                txt_loccd_2.Text = dr(74).ToString
                If STREET_LOCATION_2_CD <> "" Then
                    txt_loccd_2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                    txt_loccd_2.BackColor = Color.Red

                Else
                    txt_loccd_2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                    txt_loccd_2.BackColor = Color.White
                End If
            End If
            If dr(2).ToString = "White" Then
                'txt_fileid.Text = ""
                'txt_filedesc.Text = ""
                'cmb_formtype.Text = ""
                txt_w_add1.Text = dr(3).ToString
                If add_streetno <> "" Then
                    txt_w_add1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_w_add1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_w_add2.Text = dr(4).ToString
                If add_prefix <> "" Then
                    cmb_w_add2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_w_add2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_w_add2_1.Text = dr(5).ToString
                If add_prefix_2 <> "" Then
                    cmb_w_add2_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_w_add2_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_w_add3.Text = dr(6).ToString
                If add_streetname <> "" Then
                    cmb_w_add3.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_w_add3.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_w_add4_1.Text = dr(7).ToString
                If add_suffix <> "" Then
                    cmb_w_add4_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_w_add4_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_w_add4.Text = dr(8).ToString
                If street_suffix_cd <> "" Then
                    cmb_w_add4.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_w_add4.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                ' txt_w_name.Text = dr(9).ToString
                txt_w_dated.Text = Format(dr(10), "MM/dd/yyyy").ToString()

                If date_installed <> "" Then
                    txt_w_dated.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_w_dated.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_w_city.Text = dr(11).ToString
                If city <> "" Then
                    cmb_w_city.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_w_city.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_w_subdiv.Text = dr(12).ToString
                If subdivision <> "" Then
                    txt_w_subdiv.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_w_subdiv.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_w_serno.Text = dr(13).ToString
                cmb_w_pipesize.SelectedValue = dr(14).ToString
                If pipe_size <> "" Then

                    cmb_w_pipesize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_w_pipesize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_w_pipekind.SelectedValue = dr(15).ToString
                If pipe_type <> "" Then

                    cmb_w_pipekind.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_w_pipekind.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_w_pressure.SelectedValue = dr(16).ToString
                If pressure <> "" Then

                    cmb_w_pressure.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_w_pressure.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_w_tapzize.SelectedValue = dr(17).ToString
                If size_of_tap <> "" Then

                    cmb_w_tapzize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_w_tapzize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_w_ser_ft.Text = dr(18).ToString
                If length_main_to_curb_valve_ft = 12345 Then

                    txt_w_ser_ft.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_w_ser_ft.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If

                txt_w_ser_in.Text = dr(19).ToString
                If length_main_to_curb_valve_in = 12345 Then

                    txt_w_ser_in.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_w_ser_in.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_w_depser_ft.Text = dr(20).ToString
                If length_curb_valve_to_property_line_ft = 12345 Then

                    txt_w_depser_ft.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_w_depser_ft.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_w_mainsize.SelectedValue = dr(26).ToString
                If size_of_main <> "" Then

                    cmb_w_mainsize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_w_mainsize.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_w_maintype.SelectedValue = dr(27).ToString
                If type_of_main <> "" Then

                    cmb_w_maintype.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_w_maintype.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_w_deptmain.Text = dr(28).ToString
                If depth_of_main <> "" Then

                    txt_w_deptmain.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_w_deptmain.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_w_testedwith.SelectedValue = dr(29).ToString
                If tested_with <> "" Then

                    cmb_w_testedwith.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_w_testedwith.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                cmb_w_testedto.SelectedValue = dr(30).ToString
                If tested_to <> "" Then

                    cmb_w_testedto.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    cmb_w_testedto.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_w_psigmin.Text = dr(31).ToString
                If psig_for_minutes <> "" Then

                    txt_w_psigmin.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_w_psigmin.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_w_installedby.Text = dr(32).ToString
                If installed_by_contractor <> "" Then

                    txt_w_installedby.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_w_installedby.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_w_foreman.Text = dr(33).ToString
                If foreman <> "" Then

                    txt_w_foreman.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_w_foreman.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                txt_w_remark.Text = dr(34).ToString
                txt_w_premiseno.Text = dr(35).ToString
                If PREMISE_NO <> "" Then

                    txt_w_premiseno.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                Else
                    txt_w_premiseno.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                End If
                chk_stub.Checked = dr(36).ToString
                If f_stub <> "" Then
                    chk_stub.ForeColor = Color.Red
                Else
                    chk_stub.ForeColor = Color.Black
                End If
                chk_inserted.Checked = dr(37).ToString
                If f_inserted <> "" Then
                    chk_inserted.ForeColor = Color.Red
                Else
                    chk_inserted.ForeColor = Color.Black
                End If
                chk_retired.Checked = dr(38).ToString
                If f_retired <> "" Then
                    chk_retired.ForeColor = Color.Red
                Else
                    chk_retired.ForeColor = Color.Black
                End If
                ckh_leak.Checked = dr(39).ToString
                If f_leak <> "" Then
                    ckh_leak.ForeColor = Color.Red
                Else
                    ckh_leak.ForeColor = Color.Black
                End If
                chk_split.Checked = dr(40).ToString
                If f_split <> "" Then
                    chk_split.ForeColor = Color.Red
                Else
                    chk_split.ForeColor = Color.Black
                End If
                cmb_loccd_1.Text = dr(73).ToString
                If STREET_LOCATION_1_CD <> "" Then
                    cmb_loccd_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                    cmb_loccd_1.BackColor = Color.Red

                Else
                    cmb_loccd_1.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                    cmb_loccd_1.BackColor = Color.White

                End If
                txt_loccd_2.Text = dr(74).ToString
                If STREET_LOCATION_2_CD <> "" Then
                    txt_loccd_2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
                    txt_loccd_2.BackColor = Color.Red

                Else
                    txt_loccd_2.Font = New Font("Microsoft Sans Serif", 8.25, FontStyle.Regular)
                    txt_loccd_2.BackColor = Color.White
                End If
            End If

        End If
        If Me.btn_submit.Text = "SUBMIT" Then
            resetfiledata()
        End If

        dr.Close()
    End Sub
    Private Sub resetfiledata()
        chk_stub.Checked = False
        chk_inserted.Checked = False
        chk_retired.Checked = False
        ckh_leak.Checked = False
        chk_split.Checked = False
        cmb_loccd_1.Text = " "
        txt_loccd_2.Text = ""

        If cmb_formtype.Text.Trim = "FORM-100BLK" Then
            Me.txt_100b_add1.Text = ""
            cmb_100b_add2.Text = " "
            cmb_100b_add2_1.Text = " "
            cmb_100b_add3.Text = ""
            cmb_100b_add4_1.Text = ""
            cmb_100b_add4.Text = ""
            'Me.txt_100b_name.Text = ""
            Me.txt_100b_dated.Text = ""
            txt_100b_dateabandon.Text = ""
            Me.cmb_100b_city.SelectedIndex = -1
            'Me.txt_100b_subdiv.Text = ""
            'Me.txt_100b_serno.Text = ""
            Me.cmb_100b_pipesize.SelectedIndex = -1
            Me.cmb_100b_pipekind.SelectedIndex = -1
            Me.cmb_100b_pressure.SelectedIndex = -1
            Me.cmb_100b_tapsize.SelectedIndex = -1
            'Me.txt_100b_ser_ft.Text = ""
            'Me.txt_100b_ser_in.Text = ""
            'Me.txt_100b_depser_ft.Text = ""
            'Me.txt_100b_depser_in.Text = ""
            Me.txt_100b_mainln_ft.Text = ""
            'Me.txt_100b_mainln_in.Text = ""
            Me.txt_100b_propln_ft.Text = ""
            'Me.txt_100b_propln_in.Text = ""
            Me.txt_100b_lenmtrtomain.Text = ""
            Me.cmb_100b_mainsize.SelectedIndex = -1
            Me.cmb_100b_maintype.SelectedIndex = -1
            Me.txt_100b_deptmain.Text = ""
            Me.cmb_100b_testedwith.SelectedIndex = -1
            Me.cmb_100b_testedto.SelectedIndex = -1
            Me.txt_100b_psigmin.Text = ""
            'Me.txt_100b_installedby.Text = ""
            'Me.txt_100b_foreman.Text = ""
            Me.txt_100b_remark.Text = ""
            Me.txt_100b_premiseno.Text = ""

            txt_100b_installedyear.Text = ""
            txt_100b_a_ps_reading.Text = ""
            txt_100b_tot_anodes_1.Text = ""
            txt_100b_tot_anodes_17.Text = ""
            txt_100b_lr.Text = ""
            Me.txt_100b_incheswc.Text = ""

            ''Reset 100BLK
        ElseIf cmb_formtype.Text.Trim = "FORM-100BLK-MISC" Then
            Me.txt_100b_m_add1.Text = ""
            cmb_100b_m_add2.Text = " "
            cmb_100b_m_add2_1.Text = " "
            cmb_100b_m_add3.Text = ""
            cmb_100b_m_add4_1.Text = ""
            cmb_100b_m_add4.Text = ""
            'Me.txt_100b_m_name.Text = ""
            Me.txt_100b_m_dated.Text = ""
            txt_100b_m_dateabandon.Text = ""
            Me.cmb_100b_m_city.SelectedIndex = -1
            'Me.txt_100b_m_subdiv.Text = ""
            'Me.txt_100b_m_serno.Text = ""
            Me.cmb_100b_m_pipesize.SelectedIndex = -1
            Me.cmb_100b_m_pipekind.SelectedIndex = -1
            Me.cmb_100b_m_pressure.SelectedIndex = -1
            Me.cmb_100b_m_tapsize.SelectedIndex = -1
            'Me.txt_100b_m_ser_ft.Text = ""
            'Me.txt_100b_m_ser_in.Text = ""
            'Me.txt_100b_m_depser_ft.Text = ""
            'Me.txt_100b_m_depser_in.Text = ""
            Me.txt_100b_m_mainln_ft.Text = ""
            'Me.txt_100b_m_mainln_in.Text = ""
            Me.txt_100b_m_propln_ft.Text = ""
            'Me.txt_100b_m_propln_in.Text = ""
            Me.txt_100b_m_lenmtrtomain.Text = ""
            Me.cmb_100b_m_mainsize.SelectedIndex = -1
            Me.cmb_100b_m_maintype.SelectedIndex = -1
            Me.txt_100b_m_deptmain.Text = ""
            Me.cmb_100b_m_testedwith.SelectedIndex = -1
            Me.cmb_100b_m_testedto.SelectedIndex = -1
            Me.txt_100b_m_psigmin.Text = ""
            'Me.txt_100b_m_installedby.Text = ""
            'Me.txt_100b_m_foreman.Text = ""
            Me.txt_100b_m_remark.Text = ""
            Me.txt_100b_m_premiseno.Text = ""

            txt_100b_m_installedyear.Text = ""
            txt_100b_m_a_ps_reading.Text = ""
            txt_100b_m_tot_anodes_1.Text = ""
            txt_100b_m_tot_anodes_17.Text = ""
            txt_100b_m_lr.Text = ""
            Me.txt_100b_m_incheswc.Text = ""

        ElseIf cmb_formtype.Text.Trim = "FORM-200BLK" Then
            'file_name = Me.txt_filedesc.Text
            'file_type = Me.cmb_formtype.Text
            Me.txthouseNo1.Text = ""
            cmbPrefix11.Text = " "
            cmbPrefix22.Text = " "
            cmbStreetname1.Text = ""
            cmbsuffix12.Text = ""
            cmbsuffix22.Text = ""
            Me.txtDate1.Text = ""
            Me.txt_Retired_date.Text = ""
            Me.cmb_200b_city.Text = ""
            cmb_pipe_size.SelectedIndex = -1
            cmb_typeofservice.SelectedIndex = -1
            cmbPressure.SelectedIndex = -1
            Me.cmb_main_size.SelectedIndex = -1
            Me.cmb_main_type.SelectedIndex = -1
            Me.cmbTapSize.SelectedIndex = -1
            'Me.cmbDepthMain.SelectedIndex = -1
            Me.txtDepthMain.Text = ""
            Me.cmbMedium.SelectedIndex = -1
            'tested_to = Me.cmb_4_testedto.Text
            Me.txt_length1.Text = ""
            'installed_by_contractor = Me.txt_4_installedby.Text
            'foreman = Me.txt_4_foreman.Text
            Me.txt_Remarks.Text = ""
            chk2lbSystem.Checked = False
            'Me.chk2lbSystemNo1.Checked = False
            txt_200b_premiseno.Text = ""

            Me.txtmainToBackOfCurb.Text = ""
            Me.txt_pipesize_length.Text = ""
            Me.txtPS_Reading.Text = ""

            Me.cmbRetiredSize.SelectedIndex = -1
            Me.txtUnitsRetired.Text = ""
            Me.txtLengthRetired.Text = ""
            Me.txtRetiredQnty.Text = ""

        ElseIf cmb_formtype.Text.Trim = "Yellow" Then
            'txt_fileid.Text = ""
            'txt_filedesc.Text = ""
            'cmb_formtype.Text = ""
            Me.txt_y_add1.Text = ""
            cmb_y_add2.Text = ""
            cmb_y_add2_1.Text = " "

            cmb_y_add3.Text = ""
            cmb_y_add4_1.Text = ""
            cmb_y_add4.Text = ""
            ' Me.txt_y_name.Text = ""
            Me.txt_y_dated.Text = ""
            Me.cmb_y_city.SelectedIndex = -1
            Me.txt_y_subdiv.Text = ""
            Me.txt_y_serno.Text = ""
            Me.cmb_y_pipesize.SelectedIndex = -1
            Me.cmb_y_pipekind.SelectedIndex = -1
            Me.cmb_y_pressure.SelectedIndex = -1
            Me.cmb_y_tapzize.SelectedIndex = -1
            Me.txt_y_ser_ft.Text = ""
            Me.txt_y_ser_in.Text = ""
            Me.txt_y_depser_ft.Text = ""
            Me.txt_y_depser_in.Text = ""
            Me.txt_y_mainln_ft.Text = ""
            Me.txt_y_mainln_in.Text = ""
            Me.txt_y_propln_ft.Text = ""
            Me.txt_y_propln_in.Text = ""
            Me.cmb_y_mainsize.SelectedIndex = -1
            Me.cmb_y_maintype.SelectedIndex = -1
            Me.txt_y_deptmain.Text = ""
            Me.cmb_y_testedwith.SelectedIndex = -1
            Me.cmb_y_testedto.SelectedIndex = -1
            Me.txt_y_psigmin.Text = ""
            Me.txt_y_installedby.Text = ""
            Me.txt_y_foreman.Text = ""
            Me.txt_y_remark.Text = ""
            Me.txt_y_premiseno.Text = ""
        ElseIf cmb_formtype.Text.Trim = "ORIGINAL" Then
            'txt_fileid.Text = ""
            'txt_filedesc.Text = ""
            'cmb_formtype.Text = ""
            Me.txt_q_add1.Text = ""
            cmb_q_add2.Text = ""
            cmb_q_add2_1.Text = " "

            cmb_q_add3.Text = ""
            cmb_q_add4_1.Text = ""
            cmb_q_add4.Text = ""

            Me.txt_q_dated.Text = ""
            Me.cmb_q_city.SelectedIndex = -1

            Me.cmb_q_pipesize.SelectedIndex = -1
            Me.cmb_q_pipekind.SelectedIndex = -1

            Me.cmb_q_mainsize.SelectedIndex = -1
            Me.cmb_q_maintype.SelectedIndex = -1

            Me.cmb_q_testedwith.SelectedIndex = -1
            Me.cmb_q_testedto.SelectedIndex = -1
            Me.txt_q_psigmin.Text = ""

            Me.txt_q_remark.Text = ""
            Me.txt_q_premiseno.Text = ""


            txt_q_lenmtrtomain.Text = ""
            cmb_q_coating.SelectedIndex = -1

            chk_q_noblow.Checked = False


            chk_q_defcoatcor.Checked = False
            chk_q_multimeter.Checked = False

            chk_q_serstop.Checked = False
            chk_q_cathodpro.Checked = False
            chk_q_tee.Checked = False
            chk_q_taptee.Checked = False
            chk_q_galvanized.Checked = False
            txt_q_ttsize.Text = ""
            txt_q_ttinlet.Text = ""
            txt_q_ttoutlet.Text = ""
            chk_q_insulated.Checked = False
            chk_q_anoderiser.Checked = False
            txt_q_otheranode.Text = ""

        ElseIf cmb_formtype.Text.Trim = "MISC" Then

            Me.txt_l_add1.Text = ""
            cmb_l_add2.Text = ""
            cmb_l_add2_1.Text = " "
            cmb_l_add3.Text = ""
            cmb_l_add4_1.Text = ""
            cmb_l_add4.Text = ""
            Me.txt_l_remark.Text = ""
            Me.txt_l_premiseno.Text = ""
            cmb_l_misCtype.Text = ""

        ElseIf cmb_formtype.Text.Trim = "ORIGINAL-R" Then

            Me.txt_r_add1.Text = ""
            cmb_r_add2.Text = ""
            cmb_r_add2_1.Text = " "

            cmb_r_add3.Text = ""
            cmb_r_add4_1.Text = ""
            cmb_r_add4.Text = ""

            Me.txt_r_dated.Text = ""
            Me.cmb_r_city.SelectedIndex = -1

            Me.cmb_r_pipesize.SelectedIndex = -1
            Me.cmb_r_pipekind.SelectedIndex = -1

            Me.cmb_r_mainsize.SelectedIndex = -1
            Me.cmb_r_maintype.SelectedIndex = -1

            Me.cmb_r_testedwith.SelectedIndex = -1
            Me.cmb_r_testedto.SelectedIndex = -1
            Me.txt_r_psigmin.Text = ""

            Me.txt_r_remark.Text = ""
            Me.txt_r_premiseno.Text = ""


            txt_r_lenmtrtomain.Text = ""


            chk_r_noblow.Checked = False


            chk_r_defcoatcor.Checked = False


            chk_r_serstop.Checked = False
            chk_r_cathodpro.Checked = False

            txt_r_ttsize.Text = ""
            txt_r_ttinlet.Text = ""
            txt_r_ttoutlet.Text = ""
            chk_r_insulated.Checked = False
            chk_r_anoderiser.Checked = False
            txt_r_otheranode.Text = ""
            cmb_r_connection_data.Text = ""
            cmb_r_connection_data.SelectedIndex = -1



        ElseIf cmb_formtype.Text.Trim = "ABANDON-II" Then
            'txt_fileid.Text = ""
            'txt_filedesc.Text = ""
            'cmb_formtype.Text = ""
            Me.txt_a_add1.Text = ""
            cmb_a_add2.Text = ""
            cmb_a_add2_1.Text = " "

            cmb_a_add3.Text = ""
            cmb_a_add4_1.Text = ""
            cmb_a_add4.Text = ""

            Me.cmb_a_city.SelectedIndex = -1

            Me.cmb_a_mainsize.SelectedIndex = -1
            Me.cmb_a_maintype.SelectedIndex = -1

            Me.cmb_a_testedwith.SelectedIndex = -1


            Me.txt_a_installedby.Text = ""

            Me.txt_a_remark.Text = ""
            Me.txt_a_premiseno.Text = ""
            txt_a_lenmtrtomain.Text = ""
            txt_a_dateabandon.Text = ""
            cmb_a_reasonabandon.SelectedIndex = -1
            chk_a_noblow.Checked = False
            chk_a_gassource.Checked = False
            chk_a_tappingtee.Checked = False
            chk_a_linesealed.Checked = False
        ElseIf cmb_formtype.Text.Trim = "Form-X" Then

            Me.txt_x_add1.Text = ""
            cmb_x_add2.Text = ""
            cmb_x_add2_1.Text = " "

            cmb_x_add3.Text = ""
            cmb_x_add4_1.Text = ""
            cmb_x_add4.Text = ""

            Me.txt_x_dated.Text = ""
            Me.cmb_x_city.SelectedIndex = -1

            Me.cmb_x_pipesize.SelectedIndex = -1
            Me.cmb_x_pipekind.SelectedIndex = -1
            Me.txt_x_mainln_ft.Text = ""
            Me.txt_x_mainln_in.Text = ""
            Me.txt_x_propln_ft.Text = ""
            Me.txt_x_propln_in.Text = ""
            Me.cmb_x_mainsize.SelectedIndex = -1
            Me.cmb_x_maintype.SelectedIndex = -1

            Me.cmb_x_testedwith.SelectedIndex = -1
            Me.cmb_x_testedto.SelectedIndex = -1

            Me.txt_x_installedby.Text = ""

            Me.txt_x_remark.Text = ""
            Me.txt_x_premiseno.Text = ""
            txt_x_lenmtrtomain.Text = ""
            cmb_x_coating.SelectedIndex = -1
        ElseIf cmb_formtype.Text.Trim = "FORM-IX" Then

            Me.txt_9_add1.Text = ""
            cmb_9_add2.Text = ""
            cmb_9_add2_1.Text = " "

            cmb_9_add3.Text = ""
            cmb_9_add4_1.Text = ""
            cmb_9_add4.Text = ""

            Me.txt_9_dated.Text = ""
            Me.cmb_9_city.SelectedIndex = -1

            Me.txt_9_serno.Text = ""
            Me.cmb_9_pipesize.SelectedIndex = -1
            Me.cmb_9_pipekind.SelectedIndex = -1

            Me.cmb_9_tapzize.SelectedIndex = -1


            Me.cmb_9_mainsize.SelectedIndex = -1
            Me.cmb_9_maintype.SelectedIndex = -1

            Me.txt_9_foreman.Text = ""
            Me.txt_9_remark.Text = ""
            Me.txt_9_premiseno.Text = ""
            txt_9_lenmtrtomain.Text = ""
            cmb_9_coating.SelectedIndex = -1

        ElseIf cmb_formtype.Text.Trim = "Form-954" Then

            Me.txt_7_add1.Text = ""
            cmb_7_add2.Text = ""
            cmb_7_add2_1.Text = " "

            cmb_7_add3.Text = ""
            cmb_7_add4_1.Text = ""
            cmb_7_add4.Text = ""

            Me.txt_7_dated.Text = ""
            Me.cmb_7_city.SelectedIndex = -1

            Me.cmb_7_pipesize.SelectedIndex = -1
            Me.cmb_7_pipekind.SelectedIndex = -1

            Me.cmb_7_tapzize.SelectedIndex = -1

            Me.txt_7_mainln_ft.Text = ""
            Me.txt_7_mainln_in.Text = ""

            Me.cmb_7_mainsize.SelectedIndex = -1
            Me.cmb_7_maintype.SelectedIndex = -1

            Me.txt_7_remark.Text = ""
            Me.txt_7_premiseno.Text = ""
            txt_7_lenmtrtomain.Text = ""
            cmb_7_naturework.SelectedIndex = -1
            cmb_7_kindjoint.SelectedIndex = -1
            txt_7_splitsleeve.Text = ""
            txt_7_loccock.Text = ""
            txt_7_kindbox.Text = ""
            cmb_7_coating.SelectedIndex = -1

        ElseIf cmb_formtype.Text.Trim = "ABANDON-I" Then
            'txt_fileid.Text = ""
            'txt_filedesc.Text = ""
            'cmb_formtype.Text = ""
            Me.txt_8_add1.Text = ""
            cmb_8_add2.Text = ""
            cmb_8_add2_1.Text = " "
            cmb_8_add3.Text = ""
            cmb_8_add4_1.Text = ""
            cmb_8_add4.Text = ""
            Me.txt_8_dated.Text = ""
            Me.cmb_8_city.SelectedIndex = -1
            Me.cmb_8_mainsize.SelectedIndex = -1
            Me.cmb_8_maintype.SelectedIndex = -1

            Me.txt_8_remark.Text = ""
            Me.txt_8_premiseno.Text = ""
            txt_8_dateabandon.Text = ""
            cmb_8_coating.SelectedIndex = -1

        ElseIf cmb_formtype.Text.Trim = "Form-80I" Then
            'txt_fileid.Text = ""
            'txt_filedesc.Text = ""
            'cmb_formtype.Text = ""
            txt_6_add1.Text = ""
            cmb_6_add2.Text = ""
            cmb_6_add2_1.Text = " "

            cmb_6_add3.Text = ""
            cmb_6_add4_1.Text = ""
            cmb_6_add4.Text = ""

            txt_6_dated.Text = ""
            cmb_6_city.SelectedIndex = -1

            cmb_6_pipesize.SelectedIndex = -1
            cmb_6_pipekind.SelectedIndex = -1
            cmb_6_pipekind.SelectedIndex = -1

            txt_6_ser_ft.Text = ""
            txt_y_ser_in.Text = ""
            Me.txt_6_depser_ft.Text = ""
            Me.txt_6_depser_in.Text = ""

            Me.cmb_6_mainsize.SelectedIndex = -1
            Me.cmb_6_maintype.SelectedIndex = -1
            Me.txt_6_deptmain.Text = ""
            Me.cmb_6_testedwith.SelectedIndex = -1
            Me.cmb_6_testedto.SelectedIndex = -1
            Me.txt_6_psigmin.Text = ""

            Me.txt_6_remark.Text = ""
            Me.txt_6_premiseno.Text = ""
            txt_6_lenmtrtomain.Text = ""
        ElseIf cmb_formtype.Text.Trim = "OD-9-6-38" Then
            'txt_fileid.Text = ""
            'txt_filedesc.Text = ""
            'cmb_formtype.Text = ""
            txt_5_add1.Text = ""
            cmb_5_add2.Text = ""
            cmb_5_add2_1.Text = " "
            cmb_5_add3.Text = ""
            cmb_5_add4_1.Text = ""
            cmb_5_add4.Text = ""
            Me.txt_5_dated.Text = ""
            Me.cmb_5_city.SelectedIndex = -1
            Me.txt_5_serno.Text = ""
            Me.cmb_5_pipesize.SelectedIndex = -1
            Me.cmb_5_pipekind.SelectedIndex = -1
            Me.txt_5_ser_ft.Text = ""
            Me.txt_5_depser_ft.Text = ""
            Me.txt_5_propln_ft.Text = ""
            Me.txt_5_remark.Text = ""
            Me.txt_5_premiseno.Text = ""
        ElseIf cmb_formtype.Text.Trim = "Form235-B-702" Then
            'txt_fileid.Text = ""
            'txt_filedesc.Text = ""
            'cmb_formtype.Text = ""
            txt_4_add1.Text = ""
            cmb_4_add2.Text = ""
            cmb_4_add2_1.Text = " "

            cmb_4_add3.Text = ""
            cmb_4_add4_1.Text = ""
            cmb_4_add4.Text = ""
            'txt_4_name.Text = ""
            txt_4_dated.Text = ""
            cmb_4_city.SelectedIndex = -1

            cmb_4_pipesize.SelectedIndex = -1
            cmb_4_pipekind.SelectedIndex = -1
            cmb_4_pressure.SelectedIndex = -1

            cmb_4_mainsize.SelectedIndex = -1
            cmb_4_maintype.SelectedIndex = -1
            txt_4_deptmain.Text = ""
            cmb_4_testedwith.SelectedIndex = -1
            cmb_4_testedto.SelectedIndex = -1
            txt_4_psigmin.Text = ""
            txt_4_installedby.Text = ""
            txt_4_foreman.Text = ""
            txt_4_remark.Text = ""
            txt_4_premiseno.Text = ""
            cmb_4_condition.Text = ""
            txt_4_lenmtrtomain.Text = ""
            txt_4_sceginspect.Text = ""
        ElseIf cmb_formtype.Text.Trim = "White" Then
            'txt_fileid.Text = ""
            'txt_filedesc.Text = ""
            'cmb_formtype.Text = ""
            txt_w_add1.Text = ""
            cmb_w_add2.Text = ""

            cmb_w_add2_1.Text = " "
            cmb_w_add3.Text = ""
            cmb_w_add4_1.Text = ""
            cmb_w_add4.Text = ""
            '  txt_w_name.Text = ""
            txt_w_dated.Text = ""
            cmb_w_city.SelectedIndex = -1
            txt_w_subdiv.Text = ""
            txt_w_serno.Text = ""
            cmb_w_pipesize.SelectedIndex = -1
            cmb_w_pipekind.SelectedIndex = -1
            cmb_w_pressure.SelectedIndex = -1
            cmb_w_tapzize.SelectedIndex = -1
            txt_w_ser_ft.Text = ""
            txt_w_ser_in.Text = ""
            txt_w_depser_ft.Text = ""
            cmb_w_mainsize.SelectedIndex = -1
            cmb_w_maintype.SelectedIndex = -1
            txt_w_deptmain.Text = ""
            cmb_w_testedwith.SelectedIndex = -1
            cmb_w_testedto.SelectedIndex = -1
            txt_w_psigmin.Text = ""
            Me.txt_w_installedby.Text = ""
            txt_w_foreman.Text = ""
            txt_w_remark.Text = ""
            Me.txt_w_premiseno.Text = ""

        ElseIf Me.cmb_formtype.Text.Trim = "Orange" Then
            txt_3_add1.Text = ""
            cmb_3_add2.Text = ""
            cmb_3_add2_1.Text = " "
            cmb_3_add3.Text = ""
            cmb_3_add4_1.Text = ""
            cmb_3_add4.Text = ""
            txt_3_dated.Text = ""
            cmb_3_city.Text = ""
            cmb_3_pipesize.SelectedIndex = -1
            cmb_3_pipekind.SelectedIndex = -1
            cmb_3_pressure.SelectedIndex = -1
            cmb_3_tapzize.SelectedIndex = -1
            txt_3_ser_ft.Text = ""
            txt_3_depser_ft.Text = ""
            txt_3_mainln_ft.Text = ""
            txt_3_propln_ft.Text = ""
            cmb_3_maintype.SelectedIndex = -1
            cmb_3_mainsize.SelectedIndex = -1
            txt_3_installedby.Text = ""
            txt_3_remark.Text = ""
            txt_3_premiseno.Text = ""

        End If
    End Sub
    Private Sub btn_first_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_first.Click
        Dim a As DialogResult = MsgBox("Are you sure, you want to go to first record?", MsgBoxStyle.OkCancel, "Data QA / Verification")
        If a = Windows.Forms.DialogResult.Cancel Then Exit Sub
        If (getfirst_fileid(CInt(Me.txt_fileid.Text.Trim)) > 0) Then
            getfiledetail(getfirst_fileid(CInt(Me.txt_fileid.Text.Trim)))
        Else
            MsgBox("No More image files available.", MsgBoxStyle.Information, "First Image")
        End If
    End Sub
    Private Sub btn_prev_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_prev.Click
        If (getprev_fileid(CInt(Me.txt_fileid.Text.Trim)) > 0) Then
            getfiledetail(getprev_fileid(CInt(Me.txt_fileid.Text.Trim)))
        Else
            MsgBox("No More image files available.", MsgBoxStyle.Information, "Previous Image")
        End If
    End Sub
    Private Sub btn_next_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_next.Click
        If (getnext_fileid(CInt(Me.txt_fileid.Text.Trim)) > 0) Then
            getfiledetail(getnext_fileid(CInt(Me.txt_fileid.Text.Trim)))
        Else
            MsgBox("No More image files available.", MsgBoxStyle.Information, "Next Image")
        End If
    End Sub
    Private Sub btn_last_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_last.Click
        Dim a As DialogResult = MsgBox("Are you sure, you want to go to last record?", MsgBoxStyle.OkCancel, "Data QA / Verification")
        If a = Windows.Forms.DialogResult.Cancel Then Exit Sub

        If (getlast_fileid(CInt(Me.txt_fileid.Text.Trim)) > 0) Then
            getfiledetail(getlast_fileid(CInt(Me.txt_fileid.Text.Trim)))
        Else
            MsgBox("No More image files available.", MsgBoxStyle.Information, "Last Image")
        End If
    End Sub
    Private Function get_submitted_flag(ByVal file_id As Integer)
        Dim sflag As Boolean = False
        If conn.State = 0 Then
            conn.Open()
        End If
        Dim SQLCmd As New SqlCommand
        SQLCmd.CommandText = "Get_submitted_flag" ' Stored Procedure
        SQLCmd.CommandType = CommandType.StoredProcedure
        SQLCmd.Connection = conn
        SQLCmd.Parameters.AddWithValue("file_id", file_id)
        Dim dr1 As SqlDataReader = Nothing

        dr1 = SQLCmd.ExecuteReader(CommandBehavior.CloseConnection)
        If (dr1.Read) Then
            If Not (IsDBNull(dr1(0))) Then
                If dr1(0).ToString <> "" Then
                    sflag = True
                End If

            End If
        End If
        If conn.State = ConnectionState.Open Then
            conn.Close()
        End If
        Return sflag
    End Function
    Private Sub btn_submit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_submit.Click
        If conn.State = ConnectionState.Closed Then
            conn.Open()
        End If
        If btn_submit.Text.Trim = "UPDATE" Then

            If get_submitted_flag(CInt(txt_fileid.Text.Trim)) = True Then
                MsgBox("Scraping Data for this service card has been submitted. i.e. with Scana now.", MsgBoxStyle.Information, "Data could not be updated any more.")
                Exit Sub
            End If
            If conn.State = ConnectionState.Closed Then
                conn.Open()
            End If
            Dim a As DialogResult = MsgBox("Are you sure, you want to update the record?", MsgBoxStyle.OkCancel, "Data Entry")
            If a = Windows.Forms.DialogResult.Cancel Then Exit Sub

            If radbtnmissmatch.Checked = True Then
                Dim cmdtext As String = "SO_FrmQaMissmatchStatusupdate"
                Dim cmd1 As SqlCommand = Nothing
                cmd1 = New SqlCommand(cmdtext, conn)
                cmd1.CommandType = CommandType.StoredProcedure
                cmd1.Parameters.AddWithValue("@fileid", Me.txt_fileid.Text.Trim())
                If conn.State = 0 Then
                    conn.Open()
                End If
                cmd1.ExecuteNonQuery()
            End If
            Dim sql1 As String = "Update_Data"
            'If Me.cmb_formtype.Text = "Yellow" Then
            '    sql1 = "update tbl_servicewo set file_name = '" & Me.txt_filedesc.Text & "',file_type='" & Me.cmb_formtype.Text & "',add_streetno = '" & Me.txt_y_add1.Text & "',add_prefix = '" & cmb_y_add2.Text & "',add_prefix_2 = '" & cmb_y_add2_1.Text & "',add_streetname = '" & cmb_y_add3.Text & "',add_suffix = '" & cmb_y_add4_1.Text & "', street_suffix_cd = '" & cmb_y_add4.Text & "', name = '" & Me.txt_y_name.Text & "', date_installed = '" & Me.txt_y_dated.Text & "', city= '" & Me.cmb_y_city.Text & "',subdivision = '" & Me.txt_y_subdiv.Text & "', service_wo_no  = '" & Me.txt_y_serno.Text & "', pipe_size= '" & Replace(Me.cmb_y_pipesize.Text, "'", "''") & "',pipe_type = '" & Me.cmb_y_pipekind.Text & "', pressure = '" & Me.cmb_y_pressure.Text & "' ,size_of_tap = '" & Replace(Me.cmb_y_tapzize.Text, "'", "''") & "',length_main_to_curb_valve_ft = '" & Replace(Me.txt_y_ser_ft.Text, "'", "''") & "', length_main_to_curb_valve_in = '" & Replace(Me.txt_y_ser_in.Text, "'", "''") & "', length_curb_valve_to_property_line_ft = '" & Replace(Me.txt_y_depser_ft.Text, "'", "''") & "', length_curb_valve_to_property_line_in = '" & Replace(Me.txt_y_depser_in.Text, "'", "''") & "', length_main_to_property_line_ft = '" & Replace(Me.txt_y_mainln_ft.Text, "'", "''") & "', length_main_to_property_line_in = '" & Replace(Me.txt_y_mainln_in.Text, "'", "''") & "', length_property_line_to_meter_ft = '" & Replace(Me.txt_y_propln_ft.Text, "'", "''") & "', length_property_line_to_meter_in = '" & Replace(Me.txt_y_propln_in.Text, "'", "''") & "', size_of_main = '" & Replace(Me.cmb_y_mainsize.Text, "'", "''") & "',type_of_main = '" & Replace(Me.cmb_y_maintype.Text, "'", "''") & "',depth_of_main = '" & Me.txt_y_deptmain.Text & "', tested_with = '" & Me.cmb_y_testedwith.Text & "', tested_to = '" & Me.cmb_y_testedto.Text & "', psig_for_minutes = '" & Me.txt_y_psigmin.Text & "', installed_by_contractor = '" & Me.txt_y_installedby.Text & "', foreman = '" & Me.txt_y_foreman.Text & "', remark = '" & Replace(Me.txt_y_remark.Text, "'", "''") & "' , PREMISE_NO = '" & Me.txt_y_premiseno.Text & "' , f_stub = '" & chk_stub.Checked.ToString & "' , f_inserted = '" & chk_inserted.Checked.ToString & "' , f_retired = '" & chk_retired.Checked.ToString & "', f_leak = '" & ckh_leak.Checked.ToString & "' ,  f_split = '" & chk_split.Checked.ToString & "' , f_relocate = '" & chk_relocate.Checked.ToString & "' , f_replace = '" & chk_replace.Checked.ToString & "' where file_id = '" & Me.txt_fileid.Text.Trim & "'"
            'ElseIf cmb_formtype.Text.Trim = "ORIGINAL" Then
            '    sql1 = "update tbl_servicewo set file_name = '" & Me.txt_filedesc.Text & "',file_type='" & Me.cmb_formtype.Text & "',add_streetno = '" & Me.txt_q_add1.Text & "',add_prefix = '" & cmb_q_add2.Text & "',add_prefix_2 = '" & cmb_q_add2_1.Text & "',add_streetname = '" & cmb_q_add3.Text & "',add_suffix = '" & cmb_q_add4_1.Text & "', street_suffix_cd = '" & cmb_q_add4.Text & "',  date_installed = '" & Me.txt_q_dated.Text & "', city= '" & Me.cmb_q_city.Text & "', pipe_size= '" & Replace(Me.cmb_q_pipesize.Text, "'", "''") & "',pipe_type = '" & Me.cmb_q_pipekind.Text & "',  size_of_main = '" & Replace(Me.cmb_q_mainsize.Text, "'", "''") & "',type_of_main = '" & Replace(Me.cmb_q_maintype.Text, "'", "''") & "', tested_with = '" & Me.cmb_q_testedwith.Text & "', tested_to = '" & Me.cmb_q_testedto.Text & "', psig_for_minutes = '" & Me.txt_q_psigmin.Text & "',  remark = '" & Replace(Me.txt_q_remark.Text, "'", "''") & "' , PREMISE_NO = '" & Me.txt_q_premiseno.Text & "' , f_stub = '" & chk_stub.Checked.ToString & "' , f_inserted = '" & chk_inserted.Checked.ToString & "' , f_retired = '" & chk_retired.Checked.ToString & "', f_leak = '" & ckh_leak.Checked.ToString & "' ,  f_split = '" & chk_split.Checked.ToString & "' , f_relocate = '" & chk_relocate.Checked.ToString & "' , f_replace = '" & chk_replace.Checked.ToString & "' ,  type_coating	 = '" & Replace(cmb_q_coating.Text, "'", "''") & "', lenmtrtomain	 = '" & Replace(Me.txt_q_lenmtrtomain.Text, "'", "''") & "', f_noblow = '" & chk_q_noblow.Checked.ToString & "', f_defcoatcor = '" & chk_q_defcoatcor.Checked.ToString & "',f_multimeter = '" & chk_q_multimeter.Checked.ToString & "',f_serstop = '" & chk_q_serstop.Checked.ToString & "', f_cathodpro = '" & chk_q_cathodpro.Checked.ToString & "', f_tee = '" & chk_q_tee.Checked.ToString & "', f_taptee = '" & chk_q_taptee.Checked.ToString & "' ,f_galvanized = '" & chk_q_galvanized.Checked.ToString & "' , tap_t_size = '" & Replace(Me.txt_q_ttsize.Text, "'", "''") & "', tap_t_inlet = '" & Replace(Me.txt_q_ttinlet.Text, "'", "''") & "', tap_t_outlet = '" & Replace(Me.txt_q_ttoutlet.Text, "'", "''") & "', f_insulated = '" & chk_q_insulated.Checked.ToString & "', f_anoderiser = '" & chk_q_anoderiser.Checked.ToString & "', otheranode_lbs = '" & Replace(Me.txt_q_otheranode.Text, "'", "''") & "' where file_id = '" & Me.txt_fileid.Text.Trim & "'"
            'ElseIf cmb_formtype.Text.Trim = "MISC" Then
            '    sql1 = "update tbl_servicewo set file_name = '" & Me.txt_filedesc.Text & "',file_type='" & Me.cmb_formtype.Text & "',add_streetno = '" & Me.txt_l_add1.Text & "',add_prefix = '" & cmb_l_add2.Text & "',add_prefix_2 = '" & cmb_l_add2_1.Text & "',add_streetname = '" & cmb_l_add3.Text & "',add_suffix = '" & cmb_l_add4_1.Text & "', street_suffix_cd = '" & cmb_l_add4.Text & "',   city= '" & Me.cmb_l_city.Text & "',   remark = '" & Replace(Me.txt_l_remark.Text, "'", "''") & "' , PREMISE_NO = '" & Me.txt_l_premiseno.Text & "' , f_stub = '" & chk_stub.Checked.ToString & "' , f_inserted = '" & chk_inserted.Checked.ToString & "' , f_retired = '" & chk_retired.Checked.ToString & "', f_leak = '" & ckh_leak.Checked.ToString & "' ,  f_split = '" & chk_split.Checked.ToString & "' , f_relocate = '" & chk_relocate.Checked.ToString & "' , f_replace = '" & chk_replace.Checked.ToString & "' ,   misc_card_type = '" & Me.cmb_l_misCtype.Text & "'  where file_id = '" & Me.txt_fileid.Text.Trim & "'"
            'ElseIf cmb_formtype.Text.Trim = "ORIGINAL-R" Then
            '    sql1 = "update tbl_servicewo set file_name = '" & Me.txt_filedesc.Text & "',file_type='" & Me.cmb_formtype.Text & "',add_streetno = '" & Me.txt_r_add1.Text & "',add_prefix = '" & cmb_r_add2.Text & "',add_prefix_2 = '" & cmb_r_add2_1.Text & "',add_streetname = '" & cmb_r_add3.Text & "',add_suffix = '" & cmb_r_add4_1.Text & "', street_suffix_cd = '" & cmb_r_add4.Text & "',  date_installed = '" & Me.txt_r_dated.Text & "', city= '" & Me.cmb_r_city.Text & "', pipe_size= '" & Replace(Me.cmb_r_pipesize.Text, "'", "''") & "',pipe_type = '" & Me.cmb_r_pipekind.Text & "',  size_of_main = '" & Replace(Me.cmb_r_mainsize.Text, "'", "''") & "',type_of_main = '" & Replace(Me.cmb_r_maintype.Text, "'", "''") & "', tested_with = '" & Me.cmb_r_testedwith.Text & "', tested_to = '" & Me.cmb_r_testedto.Text & "', psig_for_minutes = '" & Me.txt_r_psigmin.Text & "',  remark = '" & Replace(Me.txt_r_remark.Text, "'", "''") & "' , PREMISE_NO = '" & Me.txt_r_premiseno.Text & "' , f_stub = '" & chk_stub.Checked.ToString & "' , f_inserted = '" & chk_inserted.Checked.ToString & "' , f_retired = '" & chk_retired.Checked.ToString & "', f_leak = '" & ckh_leak.Checked.ToString & "' ,  f_split = '" & chk_split.Checked.ToString & "'  , f_relocate = '" & chk_relocate.Checked.ToString & "' , f_replace = '" & chk_replace.Checked.ToString & "' , lenmtrtomain	 = '" & Replace(Me.txt_r_lenmtrtomain.Text, "'", "''") & "', f_noblow = '" & chk_r_noblow.Checked.ToString & "', f_defcoatcor = '" & chk_r_defcoatcor.Checked.ToString & "',f_serstop = '" & chk_r_serstop.Checked.ToString & "', f_cathodpro = '" & chk_r_cathodpro.Checked.ToString & "', tap_t_size = '" & Replace(Me.txt_r_ttsize.Text, "'", "''") & "', tap_t_inlet = '" & Replace(Me.txt_r_ttinlet.Text, "'", "''") & "', tap_t_outlet = '" & Replace(Me.txt_r_ttoutlet.Text, "'", "''") & "', f_insulated = '" & chk_r_insulated.Checked.ToString & "', f_anoderiser = '" & chk_r_anoderiser.Checked.ToString & "', otheranode_lbs = '" & Replace(Me.txt_r_otheranode.Text, "'", "''") & "' , connection_data = '" & Replace(Me.cmb_r_connection_data.Text, "'", "''") & "' where file_id = '" & Me.txt_fileid.Text.Trim & "'"
            'ElseIf Me.cmb_formtype.Text = "ABANDON-II" Then
            '    sql1 = "update tbl_servicewo set file_name = '" & Me.txt_filedesc.Text & "',file_type='" & Me.cmb_formtype.Text & "',add_streetno = '" & Me.txt_a_add1.Text & "',add_prefix = '" & cmb_a_add2.Text & "',add_prefix_2 = '" & cmb_a_add2_1.Text & "',add_streetname = '" & cmb_a_add3.Text & "',add_suffix = '" & cmb_a_add4_1.Text & "', street_suffix_cd = '" & cmb_a_add4.Text & "',  city= '" & Me.cmb_a_city.Text & "', size_of_main = '" & Replace(Me.cmb_a_mainsize.Text, "'", "''") & "',type_of_main = '" & Replace(Me.cmb_a_maintype.Text, "'", "''") & "', tested_with = '" & Me.cmb_a_testedwith.Text & "',  installed_by_contractor = '" & Me.txt_a_installedby.Text & "',  remark = '" & Replace(Me.txt_a_remark.Text, "'", "''") & "' , PREMISE_NO = '" & Me.txt_a_premiseno.Text & "' , f_stub = '" & chk_stub.Checked.ToString & "' , f_inserted = '" & chk_inserted.Checked.ToString & "' , f_retired = '" & chk_retired.Checked.ToString & "', f_leak = '" & ckh_leak.Checked.ToString & "' ,  f_split = '" & chk_split.Checked.ToString & "' , f_relocate = '" & chk_relocate.Checked.ToString & "' , f_replace = '" & chk_replace.Checked.ToString & "' , DATE_ABANDON = '" & Me.txt_a_dateabandon.Text & "', f_noblow = '" & chk_a_noblow.Checked.ToString & "' ,f_gassource = '" & chk_a_gassource.Checked.ToString & "' , f_tappingtee = '" & chk_a_tappingtee.Checked.ToString & "' , f_linesealed= '" & chk_a_linesealed.Checked.ToString & "' , lenmtrtomain	 = '" & Replace(Me.txt_a_lenmtrtomain.Text, "'", "''") & "', reason_of_abandon = '" & Replace(Me.cmb_a_reasonabandon.Text, "'", "''") & "'  where file_id = '" & Me.txt_fileid.Text.Trim & "'"
            'ElseIf Me.cmb_formtype.Text = "Form-X" Then
            '    sql1 = "update tbl_servicewo set file_name = '" & Me.txt_filedesc.Text & "',file_type='" & Me.cmb_formtype.Text & "',add_streetno = '" & Me.txt_x_add1.Text & "',add_prefix = '" & cmb_x_add2.Text & "',add_prefix_2 = '" & cmb_x_add2_1.Text & "',add_streetname = '" & cmb_x_add3.Text & "',add_suffix = '" & cmb_x_add4_1.Text & "', street_suffix_cd = '" & cmb_x_add4.Text & "',  date_installed = '" & Me.txt_x_dated.Text & "', city= '" & Me.cmb_x_city.Text & "', pipe_size= '" & Replace(Me.cmb_x_pipesize.Text, "'", "''") & "',pipe_type = '" & Me.cmb_x_pipekind.Text & "',  length_main_to_property_line_ft = '" & Replace(Me.txt_x_mainln_ft.Text, "'", "''") & "', length_main_to_property_line_in = '" & Replace(Me.txt_x_mainln_in.Text, "'", "''") & "', length_property_line_to_meter_ft = '" & Replace(Me.txt_x_propln_ft.Text, "'", "''") & "', length_property_line_to_meter_in = '" & Replace(Me.txt_x_propln_in.Text, "'", "''") & "', size_of_main = '" & Replace(Me.cmb_x_mainsize.Text, "'", "''") & "',type_of_main = '" & Replace(Me.cmb_x_maintype.Text, "'", "''") & "', tested_with = '" & Me.cmb_x_testedwith.Text & "', tested_to = '" & Me.cmb_x_testedto.Text & "',  installed_by_contractor = '" & Me.txt_x_installedby.Text & "',  remark = '" & Replace(Me.txt_x_remark.Text, "'", "''") & "' , PREMISE_NO = '" & Me.txt_x_premiseno.Text & "' , f_stub = '" & chk_stub.Checked.ToString & "' , f_inserted = '" & chk_inserted.Checked.ToString & "' , f_retired = '" & chk_retired.Checked.ToString & "', f_leak = '" & ckh_leak.Checked.ToString & "' ,  f_split = '" & chk_split.Checked.ToString & "' , f_relocate = '" & chk_relocate.Checked.ToString & "' , f_replace = '" & chk_replace.Checked.ToString & "' ,type_coating	 = '" & Replace(cmb_x_coating.Text, "'", "''") & "', lenmtrtomain	 = '" & Replace(Me.txt_x_lenmtrtomain.Text, "'", "''") & "' where file_id = '" & Me.txt_fileid.Text.Trim & "'"
            'ElseIf Me.cmb_formtype.Text = "FORM-IX" Then
            '    sql1 = "update tbl_servicewo set file_name = '" & Me.txt_filedesc.Text & "',file_type='" & Me.cmb_formtype.Text & "',add_streetno = '" & Me.txt_9_add1.Text & "',add_prefix = '" & cmb_9_add2.Text & "',add_prefix_2 = '" & cmb_9_add2_1.Text & "',add_streetname = '" & cmb_9_add3.Text & "',add_suffix = '" & cmb_9_add4_1.Text & "', street_suffix_cd = '" & cmb_9_add4.Text & "',  date_installed = '" & Me.txt_9_dated.Text & "', city= '" & Me.cmb_9_city.Text & "', service_wo_no  = '" & Me.txt_9_serno.Text & "', pipe_size= '" & Replace(Me.cmb_9_pipesize.Text, "'", "''") & "',pipe_type = '" & Me.cmb_9_pipekind.Text & "', size_of_tap = '" & Replace(Me.cmb_9_tapzize.Text, "'", "''") & "',size_of_main = '" & Replace(Me.cmb_9_mainsize.Text, "'", "''") & "',type_of_main = '" & Replace(Me.cmb_9_maintype.Text, "'", "''") & "',foreman = '" & Me.txt_9_foreman.Text & "', remark = '" & Replace(Me.txt_9_remark.Text, "'", "''") & "' , PREMISE_NO = '" & Me.txt_9_premiseno.Text & "' , f_stub = '" & chk_stub.Checked.ToString & "' , f_inserted = '" & chk_inserted.Checked.ToString & "' , f_retired = '" & chk_retired.Checked.ToString & "', f_leak = '" & ckh_leak.Checked.ToString & "' ,  f_split = '" & chk_split.Checked.ToString & "' , f_relocate = '" & chk_relocate.Checked.ToString & "' , f_replace = '" & chk_replace.Checked.ToString & "' ,lenmtrtomain	 = '" & Replace(Me.txt_9_lenmtrtomain.Text, "'", "''") & "' ,type_coating	 = '" & Replace(cmb_9_coating.Text, "'", "''") & "' where file_id = '" & Me.txt_fileid.Text.Trim & "'"
            'ElseIf Me.cmb_formtype.Text = "Orange" Then
            '    sql1 = "update tbl_servicewo set file_name = '" & Me.txt_filedesc.Text & "',file_type='" & Me.cmb_formtype.Text & "',add_streetno = '" & Me.txt_3_add1.Text & "',add_prefix = '" & cmb_3_add2.Text & "',add_streetname = '" & cmb_3_add3.Text & "',add_suffix = '" & cmb_3_add4_1.Text & "', street_suffix_cd = '" & cmb_3_add4.Text & "', city= '" & Me.cmb_3_city.Text & "',  date_installed = '" & Me.txt_3_dated.Text & "',  service_wo_no  = '" & Me.txt_3_serno.Text & "', pipe_size= '" & Replace(Me.cmb_3_pipesize.Text, "'", "''") & "',pipe_type = '" & Replace(Me.cmb_3_pipekind.Text, "'", "''") & "', pressure = '" & Me.cmb_3_pressure.Text & "' ,size_of_tap = '" & Replace(Me.cmb_3_tapzize.Text, "'", "''") & "',length_main_to_curb_valve_ft = '" & Replace(Me.txt_3_ser_ft.Text, "'", "''") & "', length_curb_valve_to_property_line_ft = '" & Replace(Me.txt_3_depser_ft.Text, "'", "''") & "',  length_main_to_property_line_ft = '" & Replace(Me.txt_3_mainln_ft.Text, "'", "''") & "',  length_property_line_to_meter_ft = '" & Replace(Me.txt_3_propln_ft.Text, "'", "''") & "',  size_of_main = '" & Replace(Me.cmb_3_mainsize.Text, "'", "''") & "',type_of_main = '" & Replace(Me.cmb_3_maintype.Text, "'", "''") & "',installed_by_contractor = '" & Me.txt_3_installedby.Text & "', remark = '" & Replace(Me.txt_3_remark.Text, "'", "''") & "' , PREMISE_NO = '" & Me.txt_3_premiseno.Text & "' , f_stub = '" & chk_stub.Checked.ToString & "' , f_inserted = '" & chk_inserted.Checked.ToString & "' , f_retired = '" & chk_retired.Checked.ToString & "', f_leak = '" & ckh_leak.Checked.ToString & "' ,  f_split = '" & chk_split.Checked.ToString & "' , f_relocate = '" & chk_relocate.Checked.ToString & "' , f_replace = '" & chk_replace.Checked.ToString & "' where file_id = '" & Me.txt_fileid.Text.Trim & "'"
            'ElseIf cmb_formtype.Text.Trim = "Form-954" Then
            '    sql1 = "update tbl_servicewo set file_name = '" & Me.txt_filedesc.Text & "',file_type='" & Me.cmb_formtype.Text & "',add_streetno = '" & Me.txt_7_add1.Text & "',add_prefix = '" & cmb_7_add2.Text & "',add_prefix_2 = '" & cmb_7_add2_1.Text & "',add_streetname = '" & cmb_7_add3.Text & "',add_suffix = '" & cmb_7_add4_1.Text & "', street_suffix_cd = '" & cmb_7_add4.Text & "',  date_installed = '" & Me.txt_7_dated.Text & "', city= '" & Me.cmb_7_city.Text & "',  pipe_size= '" & Replace(Me.cmb_7_pipesize.Text, "'", "''") & "',pipe_type = '" & Me.cmb_7_pipekind.Text & "', size_of_tap = '" & Replace(Me.cmb_7_tapzize.Text, "'", "''") & "', length_main_to_property_line_ft = '" & Replace(Me.txt_7_mainln_ft.Text, "'", "''") & "', length_main_to_property_line_in = '" & Replace(Me.txt_7_mainln_in.Text, "'", "''") & "',  size_of_main = '" & Replace(Me.cmb_7_mainsize.Text, "'", "''") & "',type_of_main = '" & Replace(Me.cmb_7_maintype.Text, "'", "''") & "', remark = '" & Replace(Me.txt_7_remark.Text, "'", "''") & "' , PREMISE_NO = '" & Me.txt_7_premiseno.Text & "' , f_stub = '" & chk_stub.Checked.ToString & "' , f_inserted = '" & chk_inserted.Checked.ToString & "' , f_retired = '" & chk_retired.Checked.ToString & "', f_leak = '" & ckh_leak.Checked.ToString & "' ,  f_split = '" & chk_split.Checked.ToString & "', f_relocate = '" & chk_relocate.Checked.ToString & "' , f_replace = '" & chk_replace.Checked.ToString & "'  ,lenmtrtomain	 = '" & Replace(Me.txt_7_lenmtrtomain.Text, "'", "''") & "'  ,nature_of_work	 = '" & Replace(cmb_7_naturework.Text, "'", "''") & "',kind_of_joint	 = '" & Replace(cmb_7_kindjoint.Text, "'", "''") & "',split_sleeve	 = '" & Replace(txt_7_splitsleeve.Text, "'", "''") & "',loc_of_cock	 = '" & Replace(txt_7_loccock.Text, "'", "''") & "',kind_of_box	 = '" & Replace(txt_7_kindbox.Text, "'", "''") & "',type_coating	 = '" & Replace(cmb_7_coating.Text, "'", "''") & "' where file_id = '" & Me.txt_fileid.Text.Trim & "'"
            'ElseIf Me.cmb_formtype.Text = "White" Then
            '    sql1 = "update tbl_servicewo set file_name = '" & Me.txt_filedesc.Text & "', file_type = '" & Me.cmb_formtype.Text & "', add_streetno = '" & Me.txt_w_add1.Text & "', add_prefix = '" & cmb_w_add2.Text & "', add_prefix_2 = '" & cmb_w_add2_1.Text & "', add_streetname = '" & cmb_w_add3.Text & "', add_suffix = '" & Me.cmb_w_add4_1.Text & "', street_suffix_cd = '" & cmb_w_add4.Text & "', name = '" & Me.txt_w_name.Text & "', date_installed = '" & Me.txt_w_dated.Text & "', city = '" & Me.cmb_w_city.Text & "', subdivision = '" & Me.txt_w_subdiv.Text & "', service_wo_no = '" & Me.txt_w_serno.Text & "', pipe_size = '" & Replace(Me.cmb_w_pipesize.Text, "'", "''") & "', pipe_type = '" & Replace(Me.cmb_w_pipekind.Text, "'", "''") & "', pressure = '" & Me.cmb_w_pressure.Text & "', size_of_tap = '" & Replace(cmb_w_tapzize.Text, "'", "''") & "', length_main_to_curb_valve_ft = '" & Replace(Me.txt_w_ser_ft.Text, "'", "''") & "',length_main_to_curb_valve_in = '" & Replace(Me.txt_w_ser_in.Text, "'", "''") & "', length_curb_valve_to_property_line_ft = '" & Replace(Me.txt_w_depser_ft.Text, "'", "''") & "', size_of_main = '" & Replace(cmb_w_mainsize.Text, "'", "''") & "', type_of_main = '" & Replace(Me.cmb_w_maintype.Text, "'", "''") & "', depth_of_main = '" & Replace(Me.txt_w_deptmain.Text, "'", "''") & "', tested_with = '" & Me.cmb_w_testedwith.Text & "', tested_to = '" & Me.cmb_w_testedto.Text & "', psig_for_minutes = '" & Me.txt_w_psigmin.Text & "', installed_by_contractor = '" & Me.txt_w_installedby.Text & "', foreman = '" & Me.txt_w_foreman.Text & "', remark = '" & Replace(Me.txt_w_remark.Text, "'", "''") & "' , PREMISE_NO = '" & Me.txt_w_premiseno.Text & "' , f_stub = '" & chk_stub.Checked.ToString & "' , f_inserted = '" & chk_inserted.Checked.ToString & "' , f_retired = '" & chk_retired.Checked.ToString & "',  f_leak = '" & ckh_leak.Checked.ToString & "' ,  f_split = '" & chk_split.Checked.ToString & "' , f_relocate = '" & chk_relocate.Checked.ToString & "' , f_replace = '" & chk_replace.Checked.ToString & "' where file_id = '" & Me.txt_fileid.Text.Trim & "'"
            'ElseIf cmb_formtype.Text = "Form235-B-702" Then
            '    sql1 = "update tbl_servicewo set file_name = '" & Me.txt_filedesc.Text & "',file_type='" & Me.cmb_formtype.Text & "',add_streetno = '" & Me.txt_4_add1.Text & "',add_prefix = '" & cmb_4_add2.Text & "',add_prefix_2 = '" & cmb_4_add2_1.Text & "',add_streetname = '" & cmb_4_add3.Text & "',add_suffix = '" & cmb_4_add4_1.Text & "', street_suffix_cd = '" & cmb_4_add4.Text & "', name = '" & Me.txt_4_name.Text & "', date_installed = '" & Me.txt_4_dated.Text & "', city= '" & Me.cmb_4_city.Text & "', pipe_size= '" & Replace(Me.cmb_4_pipesize.Text, "'", "''") & "',pipe_type = '" & Me.cmb_4_pipekind.Text & "', pressure = '" & Me.cmb_4_pressure.Text & "' , size_of_main = '" & Replace(Me.cmb_4_mainsize.Text, "'", "''") & "',type_of_main = '" & Replace(Me.cmb_4_maintype.Text, "'", "''") & "',depth_of_main = '" & Me.txt_4_deptmain.Text & "', tested_with = '" & Me.cmb_4_testedwith.Text & "', tested_to = '" & Me.cmb_4_testedto.Text & "', psig_for_minutes = '" & Me.txt_4_psigmin.Text & "', installed_by_contractor = '" & Me.txt_4_installedby.Text & "', foreman = '" & Me.txt_4_foreman.Text & "', remark = '" & Replace(Me.txt_4_remark.Text, "'", "''") & "' , PREMISE_NO = '" & Me.txt_4_premiseno.Text & "' , f_stub = '" & chk_stub.Checked.ToString & "' , f_inserted = '" & chk_inserted.Checked.ToString & "' , f_retired = '" & chk_retired.Checked.ToString & "', f_leak = '" & ckh_leak.Checked.ToString & "' ,  f_split = '" & chk_split.Checked.ToString & "' , f_relocate = '" & chk_relocate.Checked.ToString & "' , f_replace = '" & chk_replace.Checked.ToString & "'  ,pipe_condition	 = '" & Replace(Me.cmb_4_condition.Text, "'", "''") & "' ,lenmtrtomain	 = '" & Replace(Me.txt_4_lenmtrtomain.Text, "'", "''") & "' ,sceginspect	 = '" & Replace(Me.txt_4_sceginspect.Text, "'", "''") & "' where file_id = '" & Me.txt_fileid.Text.Trim & "'"
            'ElseIf Me.cmb_formtype.Text = "OD-9-6-38" Then
            '    sql1 = "update tbl_servicewo set file_name = '" & Me.txt_filedesc.Text & "',file_type='" & Me.cmb_formtype.Text & "',add_streetno = '" & Me.txt_5_add1.Text & "',add_prefix = '" & cmb_5_add2.Text & "',add_prefix_2 = '" & cmb_5_add2_1.Text & "',add_streetname = '" & cmb_5_add3.Text & "',add_suffix = '" & cmb_5_add4_1.Text & "', street_suffix_cd = '" & cmb_5_add4.Text & "',  date_installed = '" & Me.txt_5_dated.Text & "', city= '" & Me.cmb_5_city.Text & "', service_wo_no  = '" & Me.txt_5_serno.Text & "', pipe_size= '" & Replace(Me.cmb_5_pipesize.Text, "'", "''") & "',pipe_type = '" & Me.cmb_5_pipekind.Text & "', length_main_to_curb_valve_ft = '" & Replace(Me.txt_5_ser_ft.Text, "'", "''") & "',  length_curb_valve_to_property_line_ft = '" & Replace(Me.txt_5_depser_ft.Text, "'", "''") & "', length_property_line_to_meter_ft = '" & Replace(Me.txt_5_propln_ft.Text, "'", "''") & "',  remark = '" & Replace(Me.txt_5_remark.Text, "'", "''") & "' , PREMISE_NO = '" & Me.txt_5_premiseno.Text & "' , f_stub = '" & chk_stub.Checked.ToString & "' , f_inserted = '" & chk_inserted.Checked.ToString & "' , f_retired = '" & chk_retired.Checked.ToString & "', f_leak = '" & ckh_leak.Checked.ToString & "' ,  f_split = '" & chk_split.Checked.ToString & "' , f_relocate = '" & chk_relocate.Checked.ToString & "' , f_replace = '" & chk_replace.Checked.ToString & "'  where file_id = '" & Me.txt_fileid.Text.Trim & "'"
            'ElseIf Me.cmb_formtype.Text = "Form-80I" Then
            '    sql1 = "update tbl_servicewo set file_name = '" & Me.txt_filedesc.Text & "',file_type='" & Me.cmb_formtype.Text & "',add_streetno = '" & Me.txt_6_add1.Text & "',add_prefix = '" & cmb_6_add2.Text & "',add_prefix_2 = '" & cmb_6_add2_1.Text & "',add_streetname = '" & cmb_6_add3.Text & "',add_suffix = '" & cmb_6_add4_1.Text & "', street_suffix_cd = '" & cmb_6_add4.Text & "',  date_installed = '" & Me.txt_6_dated.Text & "', city= '" & Me.cmb_6_city.Text & "', pipe_size= '" & Replace(Me.cmb_6_pipesize.Text, "'", "''") & "',pipe_type = '" & Me.cmb_6_pipekind.Text & "', length_main_to_curb_valve_ft = '" & Replace(Me.txt_6_ser_ft.Text, "'", "''") & "', length_main_to_curb_valve_in = '" & Replace(Me.txt_6_ser_in.Text, "'", "''") & "', length_curb_valve_to_property_line_ft = '" & Replace(Me.txt_6_depser_ft.Text, "'", "''") & "', length_curb_valve_to_property_line_in = '" & Replace(Me.txt_6_depser_in.Text, "'", "''") & "',  size_of_main = '" & Replace(Me.cmb_6_mainsize.Text, "'", "''") & "',type_of_main = '" & Replace(Me.cmb_6_maintype.Text, "'", "''") & "',depth_of_main = '" & Me.txt_6_deptmain.Text & "', tested_with = '" & Me.cmb_6_testedwith.Text & "', tested_to = '" & Me.cmb_6_testedto.Text & "', psig_for_minutes = '" & Me.txt_6_psigmin.Text & "', remark = '" & Replace(Me.txt_6_remark.Text, "'", "''") & "' , PREMISE_NO = '" & Me.txt_6_premiseno.Text & "' , f_stub = '" & chk_stub.Checked.ToString & "' , f_inserted = '" & chk_inserted.Checked.ToString & "' , f_retired = '" & chk_retired.Checked.ToString & "', f_leak = '" & ckh_leak.Checked.ToString & "' ,  f_split = '" & chk_split.Checked.ToString & "' , f_relocate = '" & chk_relocate.Checked.ToString & "' , f_replace = '" & chk_replace.Checked.ToString & "' ,lenmtrtomain	 = '" & Replace(Me.txt_6_lenmtrtomain.Text, "'", "''") & "' where file_id = '" & Me.txt_fileid.Text.Trim & "'"
            'ElseIf cmb_formtype.Text.Trim = "ABANDON-I" Then
            '    sql1 = "update tbl_servicewo set file_name = '" & Me.txt_filedesc.Text & "',file_type='" & Me.cmb_formtype.Text & "',add_streetno = '" & Me.txt_8_add1.Text & "',add_prefix = '" & cmb_8_add2.Text & "',add_prefix_2 = '" & cmb_8_add2_1.Text & "',add_streetname = '" & cmb_8_add3.Text & "',add_suffix = '" & cmb_8_add4_1.Text & "', street_suffix_cd = '" & cmb_8_add4.Text & "',  date_installed = '" & Me.txt_8_dated.Text & "', city= '" & Me.cmb_8_city.Text & "',   size_of_main = '" & Replace(Me.cmb_8_mainsize.Text, "'", "''") & "',type_of_main = '" & Replace(Me.cmb_8_maintype.Text, "'", "''") & "', remark = '" & Replace(Me.txt_8_remark.Text, "'", "''") & "' , PREMISE_NO = '" & Me.txt_8_premiseno.Text & "' , f_stub = '" & chk_stub.Checked.ToString & "' , f_inserted = '" & chk_inserted.Checked.ToString & "' , f_retired = '" & chk_retired.Checked.ToString & "', f_leak = '" & ckh_leak.Checked.ToString & "' ,  f_split = '" & chk_split.Checked.ToString & "' , f_relocate = '" & chk_relocate.Checked.ToString & "' , f_replace = '" & chk_replace.Checked.ToString & "' , DATE_ABANDON = '" & Me.txt_8_dateabandon.Text & "',type_coating	 = '" & Replace(cmb_8_coating.Text, "'", "''") & "' where file_id = '" & Me.txt_fileid.Text.Trim & "'"
            'End If
            Dim file_id, length_main_to_curb_valve_ft, length_main_to_curb_valve_in, length_curb_valve_to_property_line_ft, length_curb_valve_to_property_line_in As Integer
            Dim file_name As String = ""
            Dim file_type As String = ""
            Dim add_streetno As String = ""
            Dim add_prefix As String = ""
            Dim add_prefix_2 As String = ""
            Dim add_streetname As String = ""
            Dim add_suffix As String = ""
            Dim street_suffix_cd As String = ""
            Dim name As String = ""
            Dim date_installed As String = ""
            Dim city As String = ""
            Dim subdivision As String = ""
            Dim service_wo_no As String = ""
            Dim pipe_size As String = ""
            Dim pipe_type As String = ""
            Dim pressure As String = ""
            Dim size_of_tap As String = ""
            Dim size_of_main As String = ""
            Dim type_of_main As String = ""
            Dim depth_of_main As String = ""
            Dim length_main_to_property_line_ft, length_main_to_property_line_in, length_property_line_to_meter_ft, length_property_line_to_meter_in As Integer
            Dim tested_with As String = ""
            Dim tested_to As String = ""
            Dim psig_for_minutes As String = ""
            Dim installed_by_contractor As String = ""
            Dim foreman As String = ""
            Dim remark As String = ""
            Dim PREMISE_NO As String = ""
            Dim f_stub, f_inserted, f_retired, f_leak, f_split, f_noblow, f_gassource, f_tappingtee, f_linesealed, f_defcoatcor, f_serstop, f_cathodpro, f_tee, f_taptee, f_galvanized, f_insulated, f_anoderiser, f_relocate, f_replace As Boolean
            Dim pipe_condition As String = ""
            Dim sceginspect As String = ""
            Dim nature_of_work As String = ""
            Dim kind_of_joint As String = ""
            Dim split_sleeve As String = ""
            Dim loc_of_cock As String = ""
            Dim kind_of_box As String = ""
            Dim type_coating As String = ""
            Dim DATE_ABANDON As String = ""
            Dim reason_of_abandon As String = ""
            Dim f_multimeter As String = ""
            Dim tap_t_size As String = ""
            Dim tap_t_inlet As String = ""
            Dim tap_t_outlet As String = ""
            Dim otheranode_lbs As String = ""
            Dim connection_data As String = ""
            Dim misc_card_type As String = ""
            Dim STREET_LOCATION_1_CD As String = ""
            Dim STREET_LOCATION_2_CD As String = ""
            Dim lenmtrtomain As Integer
            file_id = Me.txt_fileid.Text.Trim()


            'New fields for 100BLK for update
            Dim main_installed_year As String = ""
            Dim a_ps_reading As String = ""
            Dim tot_anodes_1 As String = ""
            Dim tot_anodes_17 As String = ""
            Dim lr As String = ""
            Dim inches_wc As String = ""

            'New fields for 200BLK for update
            Dim RetiredSize As String = ""
            Dim UnitsRetired As String = ""
            Dim LengthRetired As String = ""
            Dim RetiredQty As String = ""
            Dim LbSystem As Boolean


            ''UPDATE 100BLK
            If Me.cmb_formtype.Text = "FORM-100BLK" Then
                file_name = Me.txt_filedesc.Text
                file_type = Me.cmb_formtype.Text
                add_streetno = Me.txt_100b_add1.Text
                add_prefix = cmb_100b_add2.Text
                add_prefix_2 = cmb_100b_add2_1.Text
                add_streetname = cmb_100b_add3.Text
                add_suffix = cmb_100b_add4_1.Text
                street_suffix_cd = cmb_100b_add4.Text
                city = Me.cmb_100b_city.Text
                date_installed = Me.txt_100b_dated.Text
                DATE_ABANDON = txt_100b_dateabandon.Text
                'subdivision = Me.txt_y_subdiv.Text
                'service_wo_no = Me.txt_y_serno.Text
                pipe_size = Replace(Me.cmb_100b_pipesize.Text, "'", "''")
                If pipe_size Is Nothing Then
                    pipe_size = ""
                End If
                pipe_type = Me.cmb_100b_pipekind.Text
                pressure = Me.cmb_100b_pressure.Text
                size_of_tap = Replace(Me.cmb_100b_tapsize.Text, "'", "''")
                If size_of_tap Is Nothing Then
                    size_of_tap = ""
                End If
                'length_main_to_curb_valve_ft = Replace(Me.txt_y_ser_ft.Text, "'", "''")
                'length_main_to_curb_valve_in = Replace(Me.txt_y_ser_in.Text, "'", "''")
                'length_curb_valve_to_property_line_ft = Replace(Me.txt_y_depser_ft.Text, "'", "''")
                'length_curb_valve_to_property_line_in = Replace(Me.txt_y_depser_in.Text, "'", "''")
                length_main_to_property_line_ft = Replace(Me.txt_100b_mainln_ft.Text, "'", "''")
                'length_main_to_property_line_in = Replace(Me.txt_y_mainln_in.Text, "'", "''")
                length_property_line_to_meter_ft = Replace(Me.txt_100b_propln_ft.Text, "'", "''")
                'length_property_line_to_meter_in = Replace(Me.txt_y_propln_in.Text, "'", "''")
                lenmtrtomain = Replace(Me.txt_100b_lenmtrtomain.Text, "'", "''")
                size_of_main = Replace(Me.cmb_100b_mainsize.Text, "'", "''")
                If size_of_main Is Nothing Then
                    size_of_main = ""
                End If
                type_of_main = Replace(Me.cmb_100b_maintype.Text, "'", "''")
                If type_of_main Is Nothing Then
                    type_of_main = ""
                End If
                depth_of_main = Me.txt_100b_deptmain.Text
                tested_with = Me.cmb_100b_testedwith.Text
                tested_to = Me.cmb_100b_testedto.Text
                psig_for_minutes = Me.txt_100b_psigmin.Text
                'installed_by_contractor = Me.txt_y_installedby.Text
                'foreman = Me.txt_y_foreman.Text
                remark = Me.txt_100b_remark.Text
                If remark Is Nothing Then
                    remark = ""
                End If
                PREMISE_NO = Me.txt_100b_premiseno.Text
                f_stub = chk_stub.Checked.ToString
                f_inserted = chk_inserted.Checked.ToString
                f_retired = chk_retired.Checked.ToString
                f_leak = ckh_leak.Checked.ToString
                f_split = chk_split.Checked.ToString
                f_relocate = chk_relocate.Checked.ToString
                f_replace = chk_replace.Checked.ToString
                STREET_LOCATION_1_CD = Replace(cmb_loccd_1.Text, "'", "''")
                If STREET_LOCATION_1_CD Is Nothing Then
                    STREET_LOCATION_1_CD = ""
                End If
                STREET_LOCATION_2_CD = Replace(txt_loccd_2.Text, "'", "''")
                If STREET_LOCATION_2_CD Is Nothing Then
                    STREET_LOCATION_2_CD = ""
                End If

                main_installed_year = txt_100b_installedyear.Text
                a_ps_reading = txt_100b_a_ps_reading.Text
                tot_anodes_1 = txt_100b_tot_anodes_1.Text
                tot_anodes_17 = txt_100b_tot_anodes_17.Text
                lr = txt_100b_lr.Text
                inches_wc = Me.txt_100b_incheswc.Text
            End If


            ''UPDATE FORM-100BLK-MISC
            If Me.cmb_formtype.Text = "FORM-100BLK-MISC" Then
                file_name = Me.txt_filedesc.Text
                file_type = Me.cmb_formtype.Text
                add_streetno = Me.txt_100b_m_add1.Text
                add_prefix = cmb_100b_m_add2.Text
                add_prefix_2 = cmb_100b_m_add2_1.Text
                add_streetname = cmb_100b_m_add3.Text
                add_suffix = cmb_100b_m_add4_1.Text
                street_suffix_cd = cmb_100b_m_add4.Text
                city = Me.cmb_100b_m_city.Text
                date_installed = Me.txt_100b_m_dated.Text
                DATE_ABANDON = txt_100b_m_dateabandon.Text
                'subdivision = Me.txt_y_subdiv.Text
                'service_wo_no = Me.txt_y_serno.Text
                pipe_size = Replace(Me.cmb_100b_m_pipesize.Text, "'", "''")
                If pipe_size Is Nothing Then
                    pipe_size = ""
                End If
                pipe_type = Me.cmb_100b_m_pipekind.Text
                pressure = Me.cmb_100b_m_pressure.Text
                size_of_tap = Replace(Me.cmb_100b_m_tapsize.Text, "'", "''")
                If size_of_tap Is Nothing Then
                    size_of_tap = ""
                End If
                'length_main_to_curb_valve_ft = Replace(Me.txt_y_ser_ft.Text, "'", "''")
                'length_main_to_curb_valve_in = Replace(Me.txt_y_ser_in.Text, "'", "''")
                'length_curb_valve_to_property_line_ft = Replace(Me.txt_y_depser_ft.Text, "'", "''")
                'length_curb_valve_to_property_line_in = Replace(Me.txt_y_depser_in.Text, "'", "''")
                length_main_to_property_line_ft = Replace(Me.txt_100b_m_mainln_ft.Text, "'", "''")
                'length_main_to_property_line_in = Replace(Me.txt_y_mainln_in.Text, "'", "''")
                length_property_line_to_meter_ft = Replace(Me.txt_100b_m_propln_ft.Text, "'", "''")
                'length_property_line_to_meter_in = Replace(Me.txt_y_propln_in.Text, "'", "''")
                lenmtrtomain = Replace(Me.txt_100b_m_lenmtrtomain.Text, "'", "''")
                size_of_main = Replace(Me.cmb_100b_m_mainsize.Text, "'", "''")
                If size_of_main Is Nothing Then
                    size_of_main = ""
                End If
                type_of_main = Replace(Me.cmb_100b_m_maintype.Text, "'", "''")
                If type_of_main Is Nothing Then
                    type_of_main = ""
                End If
                depth_of_main = Me.txt_100b_m_deptmain.Text
                tested_with = Me.cmb_100b_m_testedwith.Text
                tested_to = Me.cmb_100b_m_testedto.Text
                psig_for_minutes = Me.txt_100b_m_psigmin.Text
                'installed_by_contractor = Me.txt_y_installedby.Text
                'foreman = Me.txt_y_foreman.Text
                remark = Me.txt_100b_m_remark.Text
                If remark Is Nothing Then
                    remark = ""
                End If
                PREMISE_NO = Me.txt_100b_m_premiseno.Text
                f_stub = chk_stub.Checked.ToString
                f_inserted = chk_inserted.Checked.ToString
                f_retired = chk_retired.Checked.ToString
                f_leak = ckh_leak.Checked.ToString
                f_split = chk_split.Checked.ToString
                f_relocate = chk_relocate.Checked.ToString
                f_replace = chk_replace.Checked.ToString
                STREET_LOCATION_1_CD = Replace(cmb_loccd_1.Text, "'", "''")
                If STREET_LOCATION_1_CD Is Nothing Then
                    STREET_LOCATION_1_CD = ""
                End If
                STREET_LOCATION_2_CD = Replace(txt_loccd_2.Text, "'", "''")
                If STREET_LOCATION_2_CD Is Nothing Then
                    STREET_LOCATION_2_CD = ""
                End If

                main_installed_year = txt_100b_m_installedyear.Text
                a_ps_reading = txt_100b_m_a_ps_reading.Text
                tot_anodes_1 = txt_100b_m_tot_anodes_1.Text
                tot_anodes_17 = txt_100b_m_tot_anodes_17.Text
                lr = txt_100b_m_lr.Text
                inches_wc = Me.txt_100b_m_incheswc.Text
            End If

            ''UPDATE 200BLK
            If Me.cmb_formtype.Text = "FORM-200BLK" Then
                file_name = Me.txt_filedesc.Text
                file_type = Me.cmb_formtype.Text
                add_streetno = Me.txthouseNo1.Text
                add_prefix = cmbPrefix11.Text
                add_prefix_2 = cmbPrefix22.Text
                add_streetname = cmbStreetname1.Text
                add_suffix = cmbsuffix12.Text
                street_suffix_cd = cmbsuffix22.Text
                city = Me.cmb_200b_city.Text
                date_installed = Me.txtDate1.Text
                DATE_ABANDON = Me.txt_Retired_date.Text

                pipe_size = Replace(Me.cmb_pipe_size.Text, "'", "''")
                If pipe_size Is Nothing Then
                    pipe_size = ""
                End If
                pipe_type = Me.cmb_typeofservice.Text
                tested_to = Me.cmbPressure.Text
                size_of_main = Replace(Me.cmb_main_size.Text, "'", "''")
                If size_of_main Is Nothing Then
                    size_of_main = ""
                End If
                type_of_main = Replace(Me.cmb_main_type.Text, "'", "''")
                If type_of_main Is Nothing Then
                    type_of_main = ""
                End If
                size_of_tap = Replace(Me.cmbTapSize.Text, "'", "''")
                If size_of_tap Is Nothing Then
                    size_of_tap = ""
                End If
                depth_of_main = Me.txtDepthMain.Text
                tested_with = Me.cmbMedium.Text
                'tested_to = Me.cmb_4_testedto.Text
                psig_for_minutes = Me.txt_length1.Text
                'installed_by_contractor = Me.txt_4_installedby.Text
                'foreman = Me.txt_4_foreman.Text
                remark = Replace(Me.txt_Remarks.Text, "'", "''")
                If remark Is Nothing Then
                    remark = ""
                End If
                PREMISE_NO = txt_200b_premiseno.Text
                LbSystem = Me.chk2lbSystem.Checked.ToString
                'chk2lbSystemNo1 = Me.chk2lbSystemNo1.Checked.ToString

                f_stub = chk_stub.Checked.ToString
                f_inserted = chk_inserted.Checked.ToString
                f_retired = chk_retired.Checked.ToString
                f_leak = ckh_leak.Checked.ToString
                f_split = chk_split.Checked.ToString
                f_relocate = chk_relocate.Checked.ToString
                f_replace = chk_replace.Checked.ToString

                length_main_to_curb_valve_ft = Me.txtmainToBackOfCurb.Text
                lenmtrtomain = Me.txt_pipesize_length.Text
                a_ps_reading = Me.txtPS_Reading.Text

                RetiredSize = Me.cmbRetiredSize.Text
                UnitsRetired = Me.txtUnitsRetired.Text
                LengthRetired = Me.txtLengthRetired.Text
                RetiredQty = Me.txtRetiredQnty.Text

                STREET_LOCATION_1_CD = Replace(cmb_loccd_1.Text, "'", "''")
                If STREET_LOCATION_1_CD Is Nothing Then
                    STREET_LOCATION_1_CD = ""
                End If
                STREET_LOCATION_2_CD = Replace(txt_loccd_2.Text, "'", "''")
                If STREET_LOCATION_2_CD Is Nothing Then
                    STREET_LOCATION_2_CD = ""
                End If
            End If

            If Me.cmb_formtype.Text = "Yellow" Then
                file_name = Me.txt_filedesc.Text
                file_type = Me.cmb_formtype.Text
                add_streetno = Me.txt_y_add1.Text
                add_prefix = cmb_y_add2.Text
                add_prefix_2 = cmb_y_add2_1.Text
                add_streetname = cmb_y_add3.Text
                add_suffix = cmb_y_add4_1.Text
                street_suffix_cd = cmb_y_add4.Text
                date_installed = Me.txt_y_dated.Text
                city = Me.cmb_y_city.Text
                subdivision = Me.txt_y_subdiv.Text
                service_wo_no = Me.txt_y_serno.Text
                pipe_size = Replace(Me.cmb_y_pipesize.Text, "'", "''")
                If pipe_size Is Nothing Then
                    pipe_size = ""
                End If
                pipe_type = Me.cmb_y_pipekind.Text
                pressure = Me.cmb_y_pressure.Text
                size_of_tap = Replace(Me.cmb_y_tapzize.Text, "'", "''")
                If size_of_tap Is Nothing Then
                    size_of_tap = ""
                End If
                length_main_to_curb_valve_ft = Replace(Me.txt_y_ser_ft.Text, "'", "''")
                length_main_to_curb_valve_in = Replace(Me.txt_y_ser_in.Text, "'", "''")
                length_curb_valve_to_property_line_ft = Replace(Me.txt_y_depser_ft.Text, "'", "''")
                length_curb_valve_to_property_line_in = Replace(Me.txt_y_depser_in.Text, "'", "''")
                length_main_to_property_line_ft = Replace(Me.txt_y_mainln_ft.Text, "'", "''")
                length_main_to_property_line_in = Replace(Me.txt_y_mainln_in.Text, "'", "''")
                length_property_line_to_meter_ft = Replace(Me.txt_y_propln_ft.Text, "'", "''")
                length_property_line_to_meter_in = Replace(Me.txt_y_propln_in.Text, "'", "''")
                size_of_main = Replace(Me.cmb_y_mainsize.Text, "'", "''")
                If size_of_main Is Nothing Then
                    size_of_main = ""
                End If
                type_of_main = Replace(Me.cmb_y_maintype.Text, "'", "''")
                If type_of_main Is Nothing Then
                    type_of_main = ""
                End If
                depth_of_main = Me.txt_y_deptmain.Text
                tested_with = Me.cmb_y_testedwith.Text
                tested_to = Me.cmb_y_testedto.Text
                psig_for_minutes = Me.txt_y_psigmin.Text
                installed_by_contractor = Me.txt_y_installedby.Text
                foreman = Me.txt_y_foreman.Text
                remark = Replace(Me.txt_y_remark.Text, "'", "''")
                If remark Is Nothing Then
                    remark = ""
                End If
                PREMISE_NO = Me.txt_y_premiseno.Text
                f_stub = chk_stub.Checked.ToString
                f_inserted = chk_inserted.Checked.ToString
                f_retired = chk_retired.Checked.ToString
                f_leak = ckh_leak.Checked.ToString
                f_split = chk_split.Checked.ToString
                f_relocate = chk_relocate.Checked.ToString
                f_replace = chk_replace.Checked.ToString
                STREET_LOCATION_1_CD = Replace(cmb_loccd_1.Text, "'", "''")
                If STREET_LOCATION_1_CD Is Nothing Then
                    STREET_LOCATION_1_CD = ""
                End If
                STREET_LOCATION_2_CD = Replace(txt_loccd_2.Text, "'", "''")
                If STREET_LOCATION_2_CD Is Nothing Then
                    STREET_LOCATION_2_CD = ""
                End If
            End If
            'sql1 = "Insert into tbl_servicewo(file_id,file_name,file_type,add_streetno,add_prefix,add_prefix_2, add_streetname,add_suffix,street_suffix_cd,date_installed,city,subdivision,service_wo_no,pipe_size,pipe_type,pressure,size_of_tap,length_main_to_curb_valve_ft,length_main_to_curb_valve_in,length_curb_valve_to_property_line_ft,length_curb_valve_to_property_line_in,length_main_to_property_line_ft,length_main_to_property_line_in,length_property_line_to_meter_ft,length_property_line_to_meter_in,size_of_main,type_of_main,depth_of_main,tested_with,tested_to,psig_for_minutes,installed_by_contractor,foreman,remark,PREMISE_NO,f_stub,f_inserted,f_retired,f_leak, f_split, f_relocate , f_replace, STREET_LOCATION_1_CD, STREET_LOCATION_2_CD ) values('" & Me.txt_fileid.Text.Trim & "','" & Me.txt_filedesc.Text & "','" & Me.cmb_formtype.Text & "','" & Me.txt_y_add1.Text & "','" & cmb_y_add2.Text & "', '" & cmb_y_add2_1.Text & "','" & cmb_y_add3.Text & "','" & cmb_y_add4_1.Text & "', '" & cmb_y_add4.Text & "','" & Me.txt_y_dated.Text & "','" & Me.cmb_y_city.Text & "','" & Me.txt_y_subdiv.Text & "','" & Me.txt_y_serno.Text & "','" & Replace(Me.cmb_y_pipesize.Text, "'", "''") & "','" & Replace(Me.cmb_y_pipekind.Text, "'", "''") & "','" & Me.cmb_y_pressure.Text & "','" & Replace(Me.cmb_y_tapzize.Text, "'", "''") & "','" & Replace(Me.txt_y_ser_ft.Text, "'", "''") & "','" & Replace(Me.txt_y_ser_in.Text, "'", "''") & "','" & Replace(Me.txt_y_depser_ft.Text, "'", "''") & "','" & Replace(Me.txt_y_depser_in.Text, "'", "''") & "','" & Replace(Me.txt_y_mainln_ft.Text, "'", "''") & "','" & Replace(Me.txt_y_mainln_in.Text, "'", "''") & "','" & Replace(Me.txt_y_propln_ft.Text, "'", "''") & "','" & Replace(Me.txt_y_propln_in.Text, "'", "''") & "','" & Replace(Me.cmb_y_mainsize.Text, "'", "''") & "','" & Me.cmb_y_maintype.Text & "','" & Me.txt_y_deptmain.Text & "','" & Me.cmb_y_testedwith.Text & "','" & Me.cmb_y_testedto.Text & "','" & Me.txt_y_psigmin.Text & "','" & Me.txt_y_installedby.Text & "','" & Me.txt_y_foreman.Text & "','" & Replace(Me.txt_y_remark.Text, "'", "''") & "','" & Me.txt_y_premiseno.Text & "', '" & chk_stub.Checked.ToString & "', '" & chk_inserted.Checked.ToString & "', '" & chk_retired.Checked.ToString & "' , '" & ckh_leak.Checked.ToString & "', '" & chk_split.Checked.ToString & "', '" & chk_relocate.Checked.ToString & "' , '" & chk_replace.Checked.ToString & "','" & Replace(cmb_loccd_1.Text, "'", "''") & "' ,'" & Replace(txt_loccd_2.Text, "'", "''") & "' )"
            If Me.cmb_formtype.Text = "ORIGINAL" Then
                file_name = Me.txt_filedesc.Text
                file_type = Me.cmb_formtype.Text
                add_streetno = Me.txt_q_add1.Text
                add_prefix = cmb_q_add2.Text
                add_prefix_2 = cmb_q_add2_1.Text
                add_streetname = cmb_q_add3.Text
                add_suffix = cmb_q_add4_1.Text
                street_suffix_cd = cmb_q_add4.Text
                date_installed = Me.txt_q_dated.Text
                city = Me.cmb_q_city.Text
                pipe_size = Replace(Me.cmb_q_pipesize.Text, "'", "''")
                If pipe_size Is Nothing Then
                    pipe_size = ""
                End If
                pipe_type = Me.cmb_q_pipekind.Text
                size_of_main = Replace(Me.cmb_q_mainsize.Text, "'", "''")
                If size_of_main Is Nothing Then
                    size_of_main = ""
                End If
                type_of_main = Replace(Me.cmb_q_maintype.Text, "'", "''")
                If type_of_main Is Nothing Then
                    type_of_main = ""
                End If
                tested_with = Me.cmb_q_testedwith.Text
                tested_to = Me.cmb_q_testedto.Text
                psig_for_minutes = Me.txt_q_psigmin.Text
                remark = Replace(Me.txt_q_remark.Text, "'", "''")
                If remark Is Nothing Then
                    remark = ""
                End If
                PREMISE_NO = Me.txt_q_premiseno.Text
                f_stub = chk_stub.Checked.ToString
                f_inserted = chk_inserted.Checked.ToString
                f_retired = chk_retired.Checked.ToString
                f_leak = ckh_leak.Checked.ToString
                f_split = chk_split.Checked.ToString
                f_relocate = chk_relocate.Checked.ToString
                f_replace = chk_replace.Checked.ToString
                type_coating = Replace(cmb_q_coating.Text, "'", "''")
                If type_coating Is Nothing Then
                    type_coating = ""
                End If
                lenmtrtomain = Replace(Me.txt_q_lenmtrtomain.Text, "'", "''")
                f_noblow = chk_q_noblow.Checked.ToString
                f_defcoatcor = chk_q_defcoatcor.Checked.ToString
                f_multimeter = chk_q_multimeter.Checked.ToString
                f_serstop = chk_q_serstop.Checked.ToString
                f_cathodpro = chk_q_cathodpro.Checked.ToString
                f_tee = chk_q_tee.Checked.ToString
                f_taptee = chk_q_taptee.Checked.ToString
                f_galvanized = chk_q_galvanized.Checked.ToString
                tap_t_size = Replace(Me.txt_q_ttsize.Text, "'", "''")
                If tap_t_size Is Nothing Then
                    tap_t_size = ""
                End If
                tap_t_inlet = Replace(Me.txt_q_ttinlet.Text, "'", "''")
                If tap_t_inlet Is Nothing Then
                    tap_t_inlet = ""
                End If
                tap_t_outlet = Replace(Me.txt_q_ttoutlet.Text, "'", "''")
                If tap_t_outlet Is Nothing Then
                    tap_t_outlet = ""
                End If
                f_insulated = chk_q_insulated.Checked.ToString
                f_anoderiser = chk_q_anoderiser.Checked.ToString
                otheranode_lbs = Replace(Me.txt_q_otheranode.Text, "'", "''")
                If otheranode_lbs Is Nothing Then
                    otheranode_lbs = ""
                End If
                STREET_LOCATION_1_CD = Replace(cmb_loccd_1.Text, "'", "''")
                If STREET_LOCATION_1_CD Is Nothing Then
                    STREET_LOCATION_1_CD = ""
                End If
                STREET_LOCATION_2_CD = Replace(txt_loccd_2.Text, "'", "''")
                If STREET_LOCATION_2_CD Is Nothing Then
                    STREET_LOCATION_2_CD = ""
                End If
            End If
            'sql1 = "Insert into tbl_servicewo(file_id,file_name,file_type,add_streetno,add_prefix,add_prefix_2, add_streetname,add_suffix,street_suffix_cd,date_installed,city,pipe_size,pipe_type,size_of_main,type_of_main,tested_with,tested_to,psig_for_minutes,remark,PREMISE_NO,f_stub,f_inserted,f_retired,f_leak, f_split,type_coating, lenmtrtomain, f_noblow , f_defcoatcor, f_multimeter,f_serstop,f_cathodpro,f_tee,f_taptee,f_galvanized,tap_t_size,tap_t_inlet,tap_t_outlet, f_insulated, f_anoderiser, otheranode_lbs, f_relocate , f_replace, STREET_LOCATION_1_CD, STREET_LOCATION_2_CD ) values('" & Me.txt_fileid.Text.Trim & "','" & Me.txt_filedesc.Text & "','" & Me.cmb_formtype.Text & "','" & Me.txt_q_add1.Text & "','" & cmb_q_add2.Text & "', '" & cmb_q_add2_1.Text & "','" & cmb_q_add3.Text & "','" & cmb_q_add4_1.Text & "', '" & cmb_q_add4.Text & "','" & Me.txt_q_dated.Text & "','" & Me.cmb_q_city.Text & "','" & Replace(Me.cmb_q_pipesize.Text, "'", "''") & "','" & Replace(Me.cmb_q_pipekind.Text, "'", "''") & "','" & Replace(Me.cmb_q_mainsize.Text, "'", "''") & "','" & Me.cmb_q_maintype.Text & "','" & Me.cmb_q_testedwith.Text & "','" & Me.cmb_q_testedto.Text & "','" & Me.txt_q_psigmin.Text & "','" & Replace(Me.txt_q_remark.Text, "'", "''") & "','" & Me.txt_q_premiseno.Text & "', '" & chk_stub.Checked.ToString & "', '" & chk_inserted.Checked.ToString & "', '" & chk_retired.Checked.ToString & "' , '" & ckh_leak.Checked.ToString & "', '" & chk_split.Checked.ToString & "','" & Replace(cmb_q_coating.Text, "'", "''") & "',  '" & Replace(Me.txt_q_lenmtrtomain.Text, "'", "''") & "','" & chk_q_noblow.Checked.ToString & "', '" & chk_q_defcoatcor.Checked.ToString & "', '" & chk_q_multimeter.Checked.ToString & "', '" & chk_q_serstop.Checked.ToString & "', '" & chk_q_cathodpro.Checked.ToString & "' , '" & chk_q_tee.Checked.ToString & "', '" & chk_q_taptee.Checked.ToString & "' , '" & chk_q_galvanized.Checked.ToString & "' , '" & Replace(Me.txt_q_ttsize.Text, "'", "''") & "' , '" & Replace(Me.txt_q_ttinlet.Text, "'", "''") & "' , '" & Replace(Me.txt_q_ttoutlet.Text, "'", "''") & "' , '" & chk_q_insulated.Checked.ToString & "' , '" & chk_q_anoderiser.Checked.ToString & "' , '" & Replace(Me.txt_q_otheranode.Text, "'", "''") & "', '" & chk_relocate.Checked.ToString & "' , '" & chk_replace.Checked.ToString & "','" & Replace(cmb_loccd_1.Text, "'", "''") & "' ,'" & Replace(txt_loccd_2.Text, "'", "''") & "' )"
            If Me.cmb_formtype.Text = "MISC" Then
                file_name = Me.txt_filedesc.Text
                file_type = Me.cmb_formtype.Text
                add_streetno = Me.txt_l_add1.Text
                add_prefix = cmb_l_add2.Text
                add_prefix_2 = cmb_l_add2_1.Text
                add_streetname = cmb_l_add3.Text
                add_suffix = cmb_l_add4_1.Text
                street_suffix_cd = cmb_l_add4.Text
                city = Me.cmb_l_city.Text
                remark = Replace(Me.txt_l_remark.Text, "'", "''")
                If remark Is Nothing Then
                    remark = ""
                End If
                PREMISE_NO = Me.txt_l_premiseno.Text
                f_stub = chk_stub.Checked.ToString
                f_inserted = chk_inserted.Checked.ToString
                f_retired = chk_retired.Checked.ToString
                f_leak = ckh_leak.Checked.ToString
                f_split = chk_split.Checked.ToString
                f_relocate = chk_relocate.Checked.ToString
                f_replace = chk_replace.Checked.ToString
                misc_card_type = Me.cmb_l_misCtype.Text
                STREET_LOCATION_1_CD = Replace(cmb_loccd_1.Text, "'", "''")
                If STREET_LOCATION_1_CD Is Nothing Then
                    STREET_LOCATION_1_CD = ""
                End If
                STREET_LOCATION_2_CD = Replace(txt_loccd_2.Text, "'", "''")
                If STREET_LOCATION_2_CD Is Nothing Then
                    STREET_LOCATION_2_CD = ""
                End If
            End If
            ' sql1 = "Insert into tbl_servicewo(file_id,file_name,file_type,add_streetno,add_prefix,add_prefix_2, add_streetname,add_suffix,street_suffix_cd,city, remark,PREMISE_NO,f_stub,f_inserted,f_retired,f_leak, f_split,misc_card_type, f_relocate , f_replace, STREET_LOCATION_1_CD, STREET_LOCATION_2_CD ) values('" & Me.txt_fileid.Text.Trim & "','" & Me.txt_filedesc.Text & "','" & Me.cmb_formtype.Text & "','" & Me.txt_l_add1.Text & "','" & cmb_l_add2.Text & "', '" & cmb_l_add2_1.Text & "','" & cmb_l_add3.Text & "','" & cmb_l_add4_1.Text & "', '" & cmb_l_add4.Text & "','" & Me.cmb_l_city.Text & "', '" & Replace(Me.txt_l_remark.Text, "'", "''") & "','" & Me.txt_l_premiseno.Text & "', '" & chk_stub.Checked.ToString & "', '" & chk_inserted.Checked.ToString & "', '" & chk_retired.Checked.ToString & "' , '" & ckh_leak.Checked.ToString & "', '" & chk_split.Checked.ToString & "', '" & Me.cmb_l_misCtype.Text & "', '" & chk_relocate.Checked.ToString & "' , '" & chk_replace.Checked.ToString & "','" & Replace(cmb_loccd_1.Text, "'", "''") & "' ,'" & Replace(txt_loccd_2.Text, "'", "''") & "' )"
            If Me.cmb_formtype.Text = "ORIGINAL-R" Then
                file_name = Me.txt_filedesc.Text
                file_type = Me.cmb_formtype.Text
                add_streetno = Me.txt_r_add1.Text
                add_prefix = cmb_r_add2.Text
                add_prefix_2 = cmb_r_add2_1.Text
                add_streetname = cmb_r_add3.Text
                add_suffix = cmb_r_add4_1.Text
                street_suffix_cd = cmb_r_add4.Text
                date_installed = Me.txt_r_dated.Text
                city = Me.cmb_r_city.Text
                pipe_size = Replace(Me.cmb_r_pipesize.Text, "'", "''")
                If pipe_size Is Nothing Then
                    pipe_size = ""
                End If
                pipe_type = Me.cmb_r_pipekind.Text
                size_of_main = Replace(Me.cmb_r_mainsize.Text, "'", "''")
                If size_of_main Is Nothing Then
                    size_of_main = ""
                End If
                type_of_main = Replace(Me.cmb_r_maintype.Text, "'", "''")
                If type_of_main Is Nothing Then
                    type_of_main = ""
                End If
                tested_with = Me.cmb_r_testedwith.Text
                tested_to = Me.cmb_r_testedto.Text
                psig_for_minutes = Me.txt_r_psigmin.Text
                remark = Replace(Me.txt_r_remark.Text, "'", "''")
                If remark Is Nothing Then
                    remark = ""
                End If
                PREMISE_NO = Me.txt_r_premiseno.Text
                f_stub = chk_stub.Checked.ToString
                f_inserted = chk_inserted.Checked.ToString
                f_retired = chk_retired.Checked.ToString
                f_leak = ckh_leak.Checked.ToString
                f_split = chk_split.Checked.ToString
                f_relocate = chk_relocate.Checked.ToString
                f_replace = chk_replace.Checked.ToString
                lenmtrtomain = Replace(Me.txt_r_lenmtrtomain.Text, "'", "''")
                f_noblow = chk_r_noblow.Checked.ToString
                f_defcoatcor = chk_r_defcoatcor.Checked.ToString
                f_serstop = chk_r_serstop.Checked.ToString
                f_cathodpro = chk_r_cathodpro.Checked.ToString
                tap_t_size = Replace(Me.txt_r_ttsize.Text, "'", "''")
                If tap_t_size Is Nothing Then
                    tap_t_size = ""
                End If
                tap_t_inlet = Replace(Me.txt_r_ttinlet.Text, "'", "''")
                If tap_t_inlet Is Nothing Then
                    tap_t_inlet = ""
                End If
                tap_t_outlet = Replace(Me.txt_r_ttoutlet.Text, "'", "''")
                If tap_t_outlet Is Nothing Then
                    tap_t_outlet = ""
                End If
                f_insulated = chk_r_insulated.Checked.ToString
                f_anoderiser = chk_r_anoderiser.Checked.ToString
                otheranode_lbs = Replace(Me.txt_r_otheranode.Text, "'", "''")
                If otheranode_lbs Is Nothing Then
                    otheranode_lbs = ""
                End If
                connection_data = Replace(Me.cmb_r_connection_data.Text, "'", "''")
                If connection_data Is Nothing Then
                    connection_data = ""
                End If
                STREET_LOCATION_1_CD = Replace(cmb_loccd_1.Text, "'", "''")
                If STREET_LOCATION_1_CD Is Nothing Then
                    STREET_LOCATION_1_CD = ""
                End If
                STREET_LOCATION_2_CD = Replace(txt_loccd_2.Text, "'", "''")
                If STREET_LOCATION_2_CD Is Nothing Then
                    STREET_LOCATION_2_CD = ""
                End If
            End If
            'sql1 = "Insert into tbl_servicewo(file_id,file_name,file_type,add_streetno,add_prefix,add_prefix_2, add_streetname,add_suffix,street_suffix_cd,date_installed,city,pipe_size,pipe_type,size_of_main,type_of_main,tested_with,tested_to,psig_for_minutes,remark,PREMISE_NO,f_stub,f_inserted,f_retired,f_leak, f_split, lenmtrtomain, f_noblow , f_defcoatcor, f_serstop,f_cathodpro,tap_t_size,tap_t_inlet,tap_t_outlet, f_insulated, f_anoderiser, otheranode_lbs, connection_data , f_relocate , f_replace, STREET_LOCATION_1_CD, STREET_LOCATION_2_CD ) values('" & Me.txt_fileid.Text.Trim & "','" & Me.txt_filedesc.Text & "','" & Me.cmb_formtype.Text & "','" & Me.txt_r_add1.Text & "','" & cmb_r_add2.Text & "', '" & cmb_r_add2_1.Text & "','" & cmb_r_add3.Text & "','" & cmb_r_add4_1.Text & "', '" & cmb_r_add4.Text & "','" & Me.txt_r_dated.Text & "','" & Me.cmb_r_city.Text & "','" & Replace(Me.cmb_r_pipesize.Text, "'", "''") & "','" & Replace(Me.cmb_r_pipekind.Text, "'", "''") & "','" & Replace(Me.cmb_r_mainsize.Text, "'", "''") & "','" & Me.cmb_r_maintype.Text & "','" & Me.cmb_r_testedwith.Text & "','" & Me.cmb_r_testedto.Text & "','" & Me.txt_r_psigmin.Text & "','" & Replace(Me.txt_r_remark.Text, "'", "''") & "','" & Me.txt_r_premiseno.Text & "', '" & chk_stub.Checked.ToString & "', '" & chk_inserted.Checked.ToString & "', '" & chk_retired.Checked.ToString & "' , '" & ckh_leak.Checked.ToString & "', '" & chk_split.Checked.ToString & "',  '" & Replace(Me.txt_r_lenmtrtomain.Text, "'", "''") & "','" & chk_r_noblow.Checked.ToString & "', '" & chk_r_defcoatcor.Checked.ToString & "',  '" & chk_r_serstop.Checked.ToString & "', '" & chk_r_cathodpro.Checked.ToString & "' ,  '" & Replace(Me.txt_r_ttsize.Text, "'", "''") & "' , '" & Replace(Me.txt_r_ttinlet.Text, "'", "''") & "' , '" & Replace(Me.txt_r_ttoutlet.Text, "'", "''") & "' , '" & chk_r_insulated.Checked.ToString & "' , '" & chk_r_anoderiser.Checked.ToString & "' , '" & Replace(Me.txt_r_otheranode.Text, "'", "''") & "', '" & Replace(Me.cmb_r_connection_data.Text, "'", "''") & "', '" & chk_relocate.Checked.ToString & "' , '" & chk_replace.Checked.ToString & "','" & Replace(cmb_loccd_1.Text, "'", "''") & "' ,'" & Replace(txt_loccd_2.Text, "'", "''") & "' )"
            If Me.cmb_formtype.Text = "ABANDON-II" Then
                file_name = Me.txt_filedesc.Text
                file_type = Me.cmb_formtype.Text
                add_streetno = Me.txt_a_add1.Text
                add_prefix = cmb_a_add2.Text
                add_prefix_2 = cmb_a_add2_1.Text
                add_streetname = cmb_a_add3.Text
                add_suffix = cmb_a_add4_1.Text
                street_suffix_cd = cmb_a_add4.Text
                city = Me.cmb_a_city.Text
                size_of_main = Replace(Me.cmb_a_mainsize.Text, "'", "''")
                If size_of_main Is Nothing Then
                    size_of_main = ""
                End If
                type_of_main = Replace(Me.cmb_a_maintype.Text, "'", "''")
                If type_of_main Is Nothing Then
                    type_of_main = ""
                End If
                depth_of_main = Me.txt_y_deptmain.Text
                tested_with = Me.cmb_a_testedwith.Text
                installed_by_contractor = Me.txt_a_installedby.Text
                remark = Replace(Me.txt_a_remark.Text, "'", "''")
                If remark Is Nothing Then
                    remark = ""
                End If
                PREMISE_NO = Me.txt_a_premiseno.Text
                f_stub = chk_stub.Checked.ToString
                f_inserted = chk_inserted.Checked.ToString
                f_retired = chk_retired.Checked.ToString
                f_leak = ckh_leak.Checked.ToString
                f_split = chk_split.Checked.ToString
                f_relocate = chk_relocate.Checked.ToString
                f_replace = chk_replace.Checked.ToString
                DATE_ABANDON = Me.txt_a_dateabandon.Text
                f_noblow = chk_a_noblow.Checked.ToString
                f_gassource = chk_a_gassource.Checked.ToString
                f_tappingtee = chk_a_tappingtee.Checked.ToString
                f_linesealed = chk_a_linesealed.Checked.ToString
                lenmtrtomain = Replace(Me.txt_a_lenmtrtomain.Text, "'", "''")
                reason_of_abandon = Replace(Me.cmb_a_reasonabandon.Text, "'", "''")
                If reason_of_abandon Is Nothing Then
                    reason_of_abandon = ""
                End If
                STREET_LOCATION_1_CD = Replace(cmb_loccd_1.Text, "'", "''")
                If STREET_LOCATION_1_CD Is Nothing Then
                    STREET_LOCATION_1_CD = ""
                End If
                STREET_LOCATION_2_CD = Replace(txt_loccd_2.Text, "'", "''")
                If STREET_LOCATION_2_CD Is Nothing Then
                    STREET_LOCATION_2_CD = ""
                End If
            End If
            'sql1 = "Insert into tbl_servicewo(file_id,file_name,file_type,add_streetno,add_prefix,add_prefix_2, add_streetname,add_suffix,street_suffix_cd,city,size_of_main,type_of_main,tested_with,installed_by_contractor,remark,PREMISE_NO,f_stub,f_inserted,f_retired,f_leak, f_split,lenmtrtomain, reason_of_abandon , DATE_ABANDON, f_noblow, f_gassource, f_tappingtee, f_linesealed, f_relocate , f_replace, STREET_LOCATION_1_CD, STREET_LOCATION_2_CD ) values('" & Me.txt_fileid.Text.Trim & "','" & Me.txt_filedesc.Text & "','" & Me.cmb_formtype.Text & "','" & Me.txt_a_add1.Text & "','" & cmb_a_add2.Text & "', '" & cmb_a_add2_1.Text & "','" & cmb_a_add3.Text & "','" & cmb_a_add4_1.Text & "', '" & cmb_a_add4.Text & "','" & Me.cmb_a_city.Text & "','" & Replace(Me.cmb_a_mainsize.Text, "'", "''") & "','" & Me.cmb_a_maintype.Text & "','" & Me.cmb_a_testedwith.Text & "','" & Me.txt_a_installedby.Text & "','" & Replace(Me.txt_a_remark.Text, "'", "''") & "','" & Me.txt_a_premiseno.Text & "', '" & chk_stub.Checked.ToString & "', '" & chk_inserted.Checked.ToString & "', '" & chk_retired.Checked.ToString & "' , '" & ckh_leak.Checked.ToString & "', '" & chk_split.Checked.ToString & "','" & Replace(Me.txt_a_lenmtrtomain.Text, "'", "''") & "', '" & Replace(Me.cmb_a_reasonabandon.Text, "'", "''") & "', '" & Me.txt_a_dateabandon.Text & "' , '" & chk_a_noblow.Checked.ToString & "' ,'" & chk_a_gassource.Checked.ToString & "' , '" & chk_a_tappingtee.Checked.ToString & "' , '" & chk_a_linesealed.Checked.ToString & "' , '" & chk_relocate.Checked.ToString & "' , '" & chk_replace.Checked.ToString & "' ,'" & Replace(cmb_loccd_1.Text, "'", "''") & "' ,'" & Replace(txt_loccd_2.Text, "'", "''") & "' )"
            If Me.cmb_formtype.Text = "Form-X" Then
                file_name = Me.txt_filedesc.Text
                file_type = Me.cmb_formtype.Text
                add_streetno = Me.txt_x_add1.Text
                add_prefix = cmb_x_add2.Text
                add_prefix_2 = cmb_x_add2_1.Text
                add_streetname = cmb_x_add3.Text
                add_suffix = cmb_x_add4_1.Text
                street_suffix_cd = cmb_x_add4.Text
                date_installed = Me.txt_x_dated.Text
                city = Me.cmb_x_city.Text
                pipe_size = Replace(Me.cmb_x_pipesize.Text, "'", "''")
                If pipe_size Is Nothing Then
                    pipe_size = ""
                End If
                pipe_type = Me.cmb_x_pipekind.Text
                length_main_to_property_line_ft = Replace(Me.txt_x_mainln_ft.Text, "'", "''")
                length_main_to_property_line_in = Replace(Me.txt_x_mainln_in.Text, "'", "''")
                length_property_line_to_meter_ft = Replace(Me.txt_x_propln_ft.Text, "'", "''")
                length_property_line_to_meter_in = Replace(Me.txt_x_propln_in.Text, "'", "''")
                size_of_main = Replace(Me.cmb_x_mainsize.Text, "'", "''")
                If size_of_main Is Nothing Then
                    size_of_main = ""
                End If
                type_of_main = Replace(Me.cmb_x_maintype.Text, "'", "''")
                If type_of_main Is Nothing Then
                    type_of_main = ""
                End If
                tested_with = Me.cmb_x_testedwith.Text
                tested_to = Me.cmb_x_testedto.Text
                installed_by_contractor = Me.txt_x_installedby.Text
                remark = Replace(Me.txt_x_remark.Text, "'", "''")
                If remark Is Nothing Then
                    remark = ""
                End If
                PREMISE_NO = Me.txt_x_premiseno.Text
                f_stub = chk_stub.Checked.ToString
                f_inserted = chk_inserted.Checked.ToString
                f_retired = chk_retired.Checked.ToString
                f_leak = ckh_leak.Checked.ToString
                f_split = chk_split.Checked.ToString
                f_relocate = chk_relocate.Checked.ToString
                f_replace = chk_replace.Checked.ToString
                type_coating = Replace(cmb_x_coating.Text, "'", "''")
                If type_coating Is Nothing Then
                    type_coating = ""
                End If
                lenmtrtomain = Replace(Me.txt_x_lenmtrtomain.Text, "'", "''")
                STREET_LOCATION_1_CD = Replace(cmb_loccd_1.Text, "'", "''")
                If STREET_LOCATION_1_CD Is Nothing Then
                    STREET_LOCATION_1_CD = ""
                End If
                STREET_LOCATION_2_CD = Replace(txt_loccd_2.Text, "'", "''")
                If STREET_LOCATION_2_CD Is Nothing Then
                    STREET_LOCATION_2_CD = ""
                End If
            End If
            'sql1 = "Insert into tbl_servicewo(file_id,file_name,file_type,add_streetno,add_prefix,add_prefix_2, add_streetname,add_suffix,street_suffix_cd,date_installed,city,pipe_size,pipe_type,length_main_to_property_line_ft,length_main_to_property_line_in,length_property_line_to_meter_ft,length_property_line_to_meter_in,size_of_main,type_of_main,tested_with,tested_to,installed_by_contractor,remark,PREMISE_NO,f_stub,f_inserted,f_retired,f_leak, f_split, type_coating, lenmtrtomain, f_relocate , f_replace, STREET_LOCATION_1_CD, STREET_LOCATION_2_CD ) values('" & Me.txt_fileid.Text.Trim & "','" & Me.txt_filedesc.Text & "','" & Me.cmb_formtype.Text & "','" & Me.txt_x_add1.Text & "','" & cmb_x_add2.Text & "', '" & cmb_x_add2_1.Text & "','" & cmb_x_add3.Text & "','" & cmb_x_add4_1.Text & "', '" & cmb_x_add4.Text & "','" & Me.txt_x_dated.Text & "','" & Me.cmb_x_city.Text & "','" & Replace(Me.cmb_x_pipesize.Text, "'", "''") & "','" & Replace(Me.cmb_x_pipekind.Text, "'", "''") & "','" & Replace(Me.txt_x_mainln_ft.Text, "'", "''") & "','" & Replace(Me.txt_x_mainln_in.Text, "'", "''") & "','" & Replace(Me.txt_x_propln_ft.Text, "'", "''") & "','" & Replace(Me.txt_x_propln_in.Text, "'", "''") & "','" & Replace(Me.cmb_x_mainsize.Text, "'", "''") & "','" & Me.cmb_x_maintype.Text & "','" & Me.cmb_x_testedwith.Text & "','" & Me.cmb_x_testedto.Text & "','" & Me.txt_x_installedby.Text & "','" & Replace(Me.txt_x_remark.Text, "'", "''") & "','" & Me.txt_x_premiseno.Text & "', '" & chk_stub.Checked.ToString & "', '" & chk_inserted.Checked.ToString & "', '" & chk_retired.Checked.ToString & "' , '" & ckh_leak.Checked.ToString & "', '" & chk_split.Checked.ToString & "' ,'" & Replace(cmb_x_coating.Text, "'", "''") & "','" & Replace(Me.txt_x_lenmtrtomain.Text, "'", "''") & "', '" & chk_relocate.Checked.ToString & "' , '" & chk_replace.Checked.ToString & "' ,'" & Replace(cmb_loccd_1.Text, "'", "''") & "' ,'" & Replace(txt_loccd_2.Text, "'", "''") & "' )"
            If Me.cmb_formtype.Text = "FORM-IX" Then
                file_name = Me.txt_filedesc.Text
                file_type = Me.cmb_formtype.Text
                add_streetno = Me.txt_9_add1.Text
                add_prefix = cmb_9_add2.Text
                add_prefix_2 = cmb_9_add2_1.Text
                add_streetname = cmb_9_add3.Text
                add_suffix = cmb_9_add4_1.Text
                street_suffix_cd = cmb_9_add4.Text
                date_installed = Me.txt_9_dated.Text
                city = Me.cmb_9_city.Text
                service_wo_no = Me.txt_9_serno.Text
                pipe_size = Replace(Me.cmb_9_pipesize.Text, "'", "''")
                If pipe_size Is Nothing Then
                    pipe_size = ""
                End If
                pipe_type = Me.cmb_9_pipekind.Text
                size_of_tap = Replace(Me.cmb_9_tapzize.Text, "'", "''")
                If size_of_tap Is Nothing Then
                    size_of_tap = ""
                End If
                size_of_main = Replace(Me.cmb_9_mainsize.Text, "'", "''")
                If size_of_main Is Nothing Then
                    size_of_main = ""
                End If
                type_of_main = Replace(Me.cmb_9_maintype.Text, "'", "''")
                If type_of_main Is Nothing Then
                    type_of_main = ""
                End If
                foreman = Me.txt_9_foreman.Text
                remark = Replace(Me.txt_9_remark.Text, "'", "''")
                If remark Is Nothing Then
                    remark = ""
                End If
                PREMISE_NO = Me.txt_9_premiseno.Text
                f_stub = chk_stub.Checked.ToString
                f_inserted = chk_inserted.Checked.ToString
                f_retired = chk_retired.Checked.ToString
                f_leak = ckh_leak.Checked.ToString
                f_split = chk_split.Checked.ToString
                f_relocate = chk_relocate.Checked.ToString
                f_replace = chk_replace.Checked.ToString
                lenmtrtomain = Replace(Me.txt_9_lenmtrtomain.Text, "'", "''")
                type_coating = Replace(cmb_9_coating.Text, "'", "''")
                If type_coating Is Nothing Then
                    type_coating = ""
                End If
                STREET_LOCATION_1_CD = Replace(cmb_loccd_1.Text, "'", "''")
                If STREET_LOCATION_1_CD Is Nothing Then
                    STREET_LOCATION_1_CD = ""
                End If
                STREET_LOCATION_2_CD = Replace(txt_loccd_2.Text, "'", "''")
                If STREET_LOCATION_2_CD Is Nothing Then
                    STREET_LOCATION_2_CD = ""
                End If
            End If
            'sql1 = "Insert into tbl_servicewo(file_id,file_name,file_type,add_streetno,add_prefix,add_prefix_2, add_streetname,add_suffix,street_suffix_cd,date_installed,city,service_wo_no,pipe_size,pipe_type,size_of_tap,size_of_main,type_of_main,foreman,remark,PREMISE_NO,f_stub,f_inserted,f_retired,f_leak, f_split,lenmtrtomain,type_coating, f_relocate , f_replace, STREET_LOCATION_1_CD, STREET_LOCATION_2_CD ) values('" & Me.txt_fileid.Text.Trim & "','" & Me.txt_filedesc.Text & "','" & Me.cmb_formtype.Text & "','" & Me.txt_9_add1.Text & "','" & cmb_9_add2.Text & "', '" & cmb_9_add2_1.Text & "','" & cmb_9_add3.Text & "','" & cmb_9_add4_1.Text & "', '" & cmb_9_add4.Text & "','" & Me.txt_9_dated.Text & "','" & Me.cmb_9_city.Text & "','" & Me.txt_9_serno.Text & "','" & Replace(Me.cmb_9_pipesize.Text, "'", "''") & "','" & Replace(Me.cmb_9_pipekind.Text, "'", "''") & "','" & Replace(Me.cmb_9_tapzize.Text, "'", "''") & "','" & Replace(Me.cmb_9_mainsize.Text, "'", "''") & "','" & Me.cmb_9_maintype.Text & "','" & Me.txt_9_foreman.Text & "','" & Replace(Me.txt_9_remark.Text, "'", "''") & "','" & Me.txt_9_premiseno.Text & "', '" & chk_stub.Checked.ToString & "', '" & chk_inserted.Checked.ToString & "', '" & chk_retired.Checked.ToString & "' , '" & ckh_leak.Checked.ToString & "', '" & chk_split.Checked.ToString & "','" & Replace(Me.txt_9_lenmtrtomain.Text, "'", "''") & "','" & Replace(cmb_9_coating.Text, "'", "''") & "', '" & chk_relocate.Checked.ToString & "' , '" & chk_replace.Checked.ToString & "' ,'" & Replace(cmb_loccd_1.Text, "'", "''") & "' ,'" & Replace(txt_loccd_2.Text, "'", "''") & "' )"
            If cmb_formtype.Text.Trim = "Form-954" Then
                file_name = Me.txt_filedesc.Text
                file_type = Me.cmb_formtype.Text
                add_streetno = Me.txt_7_add1.Text
                add_prefix = cmb_7_add2.Text
                add_prefix_2 = cmb_7_add2_1.Text
                add_streetname = cmb_7_add3.Text
                add_suffix = cmb_7_add4_1.Text
                street_suffix_cd = cmb_7_add4.Text
                date_installed = Me.txt_7_dated.Text
                city = Me.cmb_7_city.Text
                pipe_size = Replace(Me.cmb_7_pipesize.Text, "'", "''")
                If pipe_size Is Nothing Then
                    pipe_size = ""
                End If
                pipe_type = Me.cmb_7_pipekind.Text
                size_of_tap = Replace(Me.cmb_7_tapzize.Text, "'", "''")
                If size_of_tap Is Nothing Then
                    size_of_tap = ""
                End If
                length_main_to_property_line_ft = Replace(Me.txt_7_mainln_ft.Text, "'", "''")
                length_main_to_property_line_in = Replace(Me.txt_7_mainln_in.Text, "'", "''")
                size_of_main = Replace(Me.cmb_7_mainsize.Text, "'", "''")
                If size_of_main Is Nothing Then
                    size_of_main = ""
                End If
                type_of_main = Replace(Me.cmb_7_maintype.Text, "'", "''")
                If type_of_main Is Nothing Then
                    type_of_main = ""
                End If
                remark = Replace(Me.txt_7_remark.Text, "'", "''")
                If remark Is Nothing Then
                    remark = ""
                End If
                PREMISE_NO = Me.txt_7_premiseno.Text
                f_stub = chk_stub.Checked.ToString
                f_inserted = chk_inserted.Checked.ToString
                f_retired = chk_retired.Checked.ToString
                f_leak = ckh_leak.Checked.ToString
                f_split = chk_split.Checked.ToString
                f_relocate = chk_relocate.Checked.ToString
                f_replace = chk_replace.Checked.ToString
                lenmtrtomain = Replace(Me.txt_7_lenmtrtomain.Text, "'", "''")

                nature_of_work = Replace(cmb_7_naturework.Text, "'", "''")
                If nature_of_work Is Nothing Then
                    nature_of_work = ""
                End If
                kind_of_joint = Replace(cmb_7_kindjoint.Text, "'", "''")
                If kind_of_joint Is Nothing Then
                    kind_of_joint = ""
                End If
                split_sleeve = Replace(txt_7_splitsleeve.Text, "'", "''")
                If split_sleeve Is Nothing Then
                    split_sleeve = ""
                End If
                loc_of_cock = Replace(txt_7_loccock.Text, "'", "''")
                If loc_of_cock Is Nothing Then
                    loc_of_cock = ""
                End If
                kind_of_box = Replace(txt_7_kindbox.Text, "'", "''")
                If kind_of_box Is Nothing Then
                    kind_of_box = ""
                End If
                type_coating = Replace(cmb_7_coating.Text, "'", "''")
                If type_coating Is Nothing Then
                    type_coating = ""
                End If
                STREET_LOCATION_1_CD = Replace(cmb_loccd_1.Text, "'", "''")
                If STREET_LOCATION_1_CD Is Nothing Then
                    STREET_LOCATION_1_CD = ""
                End If
                STREET_LOCATION_2_CD = Replace(txt_loccd_2.Text, "'", "''")
                If STREET_LOCATION_2_CD Is Nothing Then
                    STREET_LOCATION_2_CD = ""
                End If
            End If
            'sql1 = "Insert into tbl_servicewo(file_id,file_name,file_type,add_streetno,add_prefix,add_prefix_2, add_streetname,add_suffix,street_suffix_cd,date_installed,city,pipe_size,pipe_type,size_of_tap,length_main_to_property_line_ft,length_main_to_property_line_in,size_of_main,type_of_main,remark,PREMISE_NO,f_stub,f_inserted,f_retired,f_leak, f_split,lenmtrtomain,nature_of_work,kind_of_joint, split_sleeve, loc_of_cock, kind_of_box, type_coating, f_relocate , f_replace, STREET_LOCATION_1_CD, STREET_LOCATION_2_CD ) values('" & Me.txt_fileid.Text.Trim & "','" & Me.txt_filedesc.Text & "','" & Me.cmb_formtype.Text & "','" & Me.txt_7_add1.Text & "','" & cmb_7_add2.Text & "', '" & cmb_7_add2_1.Text & "','" & cmb_7_add3.Text & "','" & cmb_7_add4_1.Text & "', '" & cmb_7_add4.Text & "','" & Me.txt_7_dated.Text & "','" & Me.cmb_7_city.Text & "','" & Replace(Me.cmb_7_pipesize.Text, "'", "''") & "','" & Replace(Me.cmb_7_pipekind.Text, "'", "''") & "','" & Replace(Me.cmb_7_tapzize.Text, "'", "''") & "','" & Replace(Me.txt_7_mainln_ft.Text, "'", "''") & "','" & Replace(Me.txt_7_mainln_in.Text, "'", "''") & "','" & Replace(Me.cmb_7_mainsize.Text, "'", "''") & "','" & Me.cmb_7_maintype.Text & "','" & Replace(Me.txt_7_remark.Text, "'", "''") & "','" & Me.txt_7_premiseno.Text & "', '" & chk_stub.Checked.ToString & "', '" & chk_inserted.Checked.ToString & "', '" & chk_retired.Checked.ToString & "' , '" & ckh_leak.Checked.ToString & "', '" & chk_split.Checked.ToString & "','" & Replace(Me.txt_7_lenmtrtomain.Text, "'", "''") & "','" & Replace(cmb_7_naturework.Text, "'", "''") & "','" & Replace(cmb_7_kindjoint.Text, "'", "''") & "','" & Replace(txt_7_splitsleeve.Text, "'", "''") & "', '" & Replace(txt_7_loccock.Text, "'", "''") & "','" & Replace(txt_7_kindbox.Text, "'", "''") & "','" & Replace(cmb_7_coating.Text, "'", "''") & "', '" & chk_relocate.Checked.ToString & "' , '" & chk_replace.Checked.ToString & "' ,'" & Replace(cmb_loccd_1.Text, "'", "''") & "' ,'" & Replace(txt_loccd_2.Text, "'", "''") & "' )"
            If Me.cmb_formtype.Text = "Orange" Then
                file_name = Me.txt_filedesc.Text & ""
                file_type = Me.cmb_formtype.Text
                add_streetno = Me.txt_3_add1.Text
                add_prefix = cmb_3_add2.Text
                add_streetname = cmb_3_add3.Text
                add_suffix = cmb_3_add4_1.Text
                street_suffix_cd = cmb_3_add4.Text
                city = Me.cmb_3_city.Text
                date_installed = Me.txt_3_dated.Text
                service_wo_no = Me.txt_3_serno.Text
                pipe_size = Replace(Me.cmb_3_pipesize.Text, "'", "''")
                If pipe_size Is Nothing Then
                    pipe_size = ""
                End If
                pipe_type = Replace(Me.cmb_3_pipekind.Text, "'", "''")
                If pipe_type Is Nothing Then
                    pipe_type = ""
                End If
                pressure = Me.cmb_3_pressure.Text
                size_of_tap = Replace(Me.cmb_3_tapzize.Text, "'", "''")
                If size_of_tap Is Nothing Then
                    size_of_tap = ""
                End If
                length_main_to_curb_valve_ft = Replace(Me.txt_3_ser_ft.Text, "'", "''")
                length_curb_valve_to_property_line_ft = Replace(Me.txt_3_depser_ft.Text, "'", "''")
                length_main_to_property_line_ft = Replace(Me.txt_3_mainln_ft.Text, "'", "''")
                length_property_line_to_meter_ft = Replace(Me.txt_3_propln_ft.Text, "'", "''")
                size_of_main = Replace(Me.cmb_3_mainsize.Text, "'", "''")
                If size_of_main Is Nothing Then
                    size_of_main = ""
                End If
                type_of_main = Replace(Me.cmb_3_maintype.Text, "'", "''")
                If type_of_main Is Nothing Then
                    type_of_main = ""
                End If
                installed_by_contractor = Me.txt_3_installedby.Text
                remark = Replace(Me.txt_3_remark.Text, "'", "''")
                If remark Is Nothing Then
                    remark = ""
                End If
                PREMISE_NO = Me.txt_3_premiseno.Text
                f_stub = chk_stub.Checked.ToString
                f_inserted = chk_inserted.Checked.ToString
                f_retired = chk_retired.Checked.ToString
                f_leak = ckh_leak.Checked.ToString
                f_split = chk_split.Checked.ToString
                f_relocate = chk_relocate.Checked.ToString
                f_replace = chk_replace.Checked.ToString
                STREET_LOCATION_1_CD = Replace(cmb_loccd_1.Text, "'", "''")
                If STREET_LOCATION_1_CD Is Nothing Then
                    STREET_LOCATION_1_CD = ""
                End If
                STREET_LOCATION_2_CD = Replace(txt_loccd_2.Text, "'", "''")
                If STREET_LOCATION_2_CD Is Nothing Then
                    STREET_LOCATION_2_CD = ""
                End If
            End If
            'sql1 = "Insert into tbl_servicewo(file_id,file_name,file_type,add_streetno,add_prefix,add_prefix_2, add_streetname,add_suffix,street_suffix_cd,date_installed,city,service_wo_no,pipe_size,pipe_type,pressure,size_of_tap,length_main_to_curb_valve_ft,length_curb_valve_to_property_line_ft,length_main_to_property_line_ft,length_property_line_to_meter_ft,size_of_main,type_of_main,installed_by_contractor,remark,PREMISE_NO,f_stub,f_inserted,f_retired,f_leak, f_split, f_relocate , f_replace, STREET_LOCATION_1_CD, STREET_LOCATION_2_CD ) values('" & Me.txt_fileid.Text.Trim & "','" & Me.txt_filedesc.Text & "','" & Me.cmb_formtype.Text & "','" & Me.txt_3_add1.Text & "','" & cmb_3_add2.Text & "', '" & cmb_3_add2_1.Text & "','" & cmb_3_add3.Text & "','" & cmb_3_add4_1.Text & "', '" & cmb_3_add4.Text & "','" & Me.txt_3_dated.Text & "','" & Me.cmb_3_city.Text & "', '" & Me.txt_3_serno.Text & "','" & Replace(Me.cmb_3_pipesize.Text, "'", "''") & "','" & Replace(Me.cmb_3_pipekind.Text, "'", "''") & "','" & Me.cmb_3_pressure.Text & "','" & Replace(Me.cmb_3_tapzize.Text, "'", "''") & "','" & Replace(Me.txt_3_ser_ft.Text, "'", "''") & "','" & Replace(Me.txt_3_depser_ft.Text, "'", "''") & "','" & Replace(Me.txt_3_mainln_ft.Text, "'", "''") & "','" & Replace(Me.txt_3_propln_ft.Text, "'", "''") & "','" & Replace(Me.cmb_3_mainsize.Text, "'", "''") & "','" & Me.cmb_3_maintype.Text & "','" & Me.txt_3_installedby.Text & "','" & Replace(Me.txt_3_remark.Text, "'", "''") & "','" & Me.txt_3_premiseno.Text & "', '" & chk_stub.Checked.ToString & "', '" & chk_inserted.Checked.ToString & "', '" & chk_retired.Checked.ToString & "' , '" & ckh_leak.Checked.ToString & "', '" & chk_split.Checked.ToString & "', '" & chk_relocate.Checked.ToString & "' , '" & chk_replace.Checked.ToString & "' ,'" & Replace(cmb_loccd_1.Text, "'", "''") & "' ,'" & Replace(txt_loccd_2.Text, "'", "''") & "' )"
            If Me.cmb_formtype.Text = "White" Then
                file_name = Me.txt_filedesc.Text
                file_type = Me.cmb_formtype.Text
                add_streetno = Me.txt_w_add1.Text
                add_prefix = cmb_w_add2.Text
                add_prefix_2 = cmb_w_add2_1.Text
                add_streetname = cmb_w_add3.Text
                add_suffix = Me.cmb_w_add4_1.Text
                street_suffix_cd = cmb_w_add4.Text
                date_installed = Me.txt_w_dated.Text
                city = Me.cmb_w_city.Text
                subdivision = Me.txt_w_subdiv.Text
                service_wo_no = Me.txt_w_serno.Text
                pipe_size = Replace(Me.cmb_w_pipesize.Text, "'", "''")
                If pipe_size Is Nothing Then
                    pipe_size = ""
                End If
                pipe_type = Replace(Me.cmb_w_pipekind.Text, "'", "''")
                If pipe_type Is Nothing Then
                    pipe_type = ""
                End If
                pressure = Me.cmb_w_pressure.Text
                size_of_tap = Replace(cmb_w_tapzize.Text, "'", "''")
                If size_of_tap Is Nothing Then
                    size_of_tap = ""
                End If
                length_main_to_curb_valve_ft = Replace(Me.txt_w_ser_ft.Text, "'", "''")
                length_main_to_curb_valve_in = Replace(Me.txt_w_ser_in.Text, "'", "''")
                length_curb_valve_to_property_line_ft = Replace(Me.txt_w_depser_ft.Text, "'", "''")
                size_of_main = Replace(cmb_w_mainsize.Text, "'", "''")
                If size_of_main Is Nothing Then
                    size_of_main = ""
                End If
                type_of_main = Replace(Me.cmb_w_maintype.Text, "'", "''")
                If type_of_main Is Nothing Then
                    type_of_main = ""
                End If
                depth_of_main = Replace(Me.txt_w_deptmain.Text, "'", "''")
                If depth_of_main Is Nothing Then
                    depth_of_main = ""
                End If
                tested_with = Me.cmb_w_testedwith.Text
                tested_to = Me.cmb_w_testedto.Text
                psig_for_minutes = Me.txt_w_psigmin.Text
                installed_by_contractor = Me.txt_w_installedby.Text
                foreman = Me.txt_w_foreman.Text
                remark = Replace(Me.txt_w_remark.Text, "'", "''")
                If remark Is Nothing Then
                    remark = ""
                End If
                PREMISE_NO = Me.txt_w_premiseno.Text
                f_stub = chk_stub.Checked.ToString
                f_inserted = chk_inserted.Checked.ToString
                f_retired = chk_retired.Checked.ToString
                f_leak = ckh_leak.Checked.ToString
                f_split = chk_split.Checked.ToString
                f_relocate = chk_relocate.Checked.ToString
                f_replace = chk_replace.Checked.ToString
                STREET_LOCATION_1_CD = Replace(cmb_loccd_1.Text, "'", "''")
                If STREET_LOCATION_1_CD Is Nothing Then
                    STREET_LOCATION_1_CD = ""
                End If
                STREET_LOCATION_2_CD = Replace(txt_loccd_2.Text, "'", "''")
                If STREET_LOCATION_2_CD Is Nothing Then
                    STREET_LOCATION_2_CD = ""
                End If
            End If
            'sql1 = "Insert into tbl_servicewo(file_id,file_name,file_type,add_streetno,add_prefix,add_prefix_2,add_streetname,add_suffix,street_suffix_cd,date_installed,city,subdivision,service_wo_no,pipe_size,pipe_type,pressure,size_of_tap,length_main_to_curb_valve_ft,length_main_to_curb_valve_in,length_curb_valve_to_property_line_ft,size_of_main,type_of_main,depth_of_main,tested_with,tested_to,psig_for_minutes,installed_by_contractor,foreman,remark,PREMISE_NO,f_stub,f_inserted,f_retired,f_leak, f_split, f_relocate , f_replace, STREET_LOCATION_1_CD, STREET_LOCATION_2_CD ) values('" & Me.txt_fileid.Text.Trim & "','" & Me.txt_filedesc.Text & "','" & Me.cmb_formtype.Text & "','" & Me.txt_w_add1.Text & "','" & cmb_w_add2.Text & "','" & cmb_w_add2_1.Text & "','" & cmb_w_add3.Text & "','" & cmb_w_add4_1.Text & "','" & Me.cmb_w_add4.Text & "','" & Me.txt_w_dated.Text & "','" & Me.cmb_w_city.Text & "','" & Me.txt_w_subdiv.Text & "','" & Me.txt_w_serno.Text & "','" & Replace(Me.cmb_w_pipesize.Text, "'", "''") & "','" & Replace(Me.cmb_w_pipekind.Text, "'", "''") & "','" & Me.cmb_w_pressure.Text & "','" & Replace(cmb_w_tapzize.Text, "'", "''") & "','" & Replace(Me.txt_w_ser_ft.Text, "'", "''") & "','" & Replace(Me.txt_w_ser_in.Text, "'", "''") & "','" & Replace(Me.txt_w_depser_ft.Text, "'", "''") & "','" & Replace(cmb_w_mainsize.Text, "'", "''") & "','" & Me.cmb_w_maintype.Text & "','" & Me.txt_w_deptmain.Text & "','" & Me.cmb_w_testedwith.Text & "','" & Me.cmb_w_testedto.Text & "','" & Me.txt_w_psigmin.Text & "','" & Me.txt_w_installedby.Text & "','" & Me.txt_w_foreman.Text & "','" & Replace(Me.txt_w_remark.Text, "'", "''") & "','" & Me.txt_w_premiseno.Text & "', '" & chk_stub.Checked.ToString & "', '" & chk_inserted.Checked.ToString & "', '" & chk_retired.Checked.ToString & "' , '" & ckh_leak.Checked.ToString & "', '" & chk_split.Checked.ToString & "', '" & chk_relocate.Checked.ToString & "' , '" & chk_replace.Checked.ToString & "' ,'" & Replace(cmb_loccd_1.Text, "'", "''") & "' ,'" & Replace(txt_loccd_2.Text, "'", "''") & "' )"
            If Me.cmb_formtype.Text = "Form235-B-702" Then
                file_name = Me.txt_filedesc.Text
                file_type = Me.cmb_formtype.Text
                add_streetno = Me.txt_4_add1.Text
                add_prefix = cmb_4_add2.Text
                add_prefix_2 = cmb_4_add2_1.Text
                add_streetname = cmb_4_add3.Text
                add_suffix = cmb_4_add4_1.Text
                street_suffix_cd = cmb_4_add4.Text
                date_installed = Me.txt_4_dated.Text
                city = Me.cmb_4_city.Text
                pipe_size = Replace(Me.cmb_4_pipesize.Text, "'", "''")
                If pipe_size Is Nothing Then
                    pipe_size = ""
                End If
                pipe_type = Me.cmb_4_pipekind.Text
                pressure = Me.cmb_4_pressure.Text
                size_of_main = Replace(Me.cmb_4_mainsize.Text, "'", "''")
                If size_of_main Is Nothing Then
                    size_of_main = ""
                End If
                type_of_main = Replace(Me.cmb_4_maintype.Text, "'", "''")
                If type_of_main Is Nothing Then
                    type_of_main = ""
                End If
                depth_of_main = Me.txt_4_deptmain.Text
                tested_with = Me.cmb_4_testedwith.Text
                tested_to = Me.cmb_4_testedto.Text
                psig_for_minutes = Me.txt_4_psigmin.Text
                installed_by_contractor = Me.txt_4_installedby.Text
                foreman = Me.txt_4_foreman.Text
                remark = Replace(Me.txt_4_remark.Text, "'", "''")
                If remark Is Nothing Then
                    remark = ""
                End If
                PREMISE_NO = Me.txt_4_premiseno.Text
                f_stub = chk_stub.Checked.ToString
                f_inserted = chk_inserted.Checked.ToString
                f_retired = chk_retired.Checked.ToString
                f_leak = ckh_leak.Checked.ToString
                f_split = chk_split.Checked.ToString
                f_relocate = chk_relocate.Checked.ToString
                f_replace = chk_replace.Checked.ToString
                pipe_condition = Replace(Me.cmb_4_condition.Text, "'", "''")
                If pipe_condition Is Nothing Then
                    pipe_condition = ""
                End If
                lenmtrtomain = Replace(Me.txt_4_lenmtrtomain.Text, "'", "''")
                sceginspect = Replace(Me.txt_4_sceginspect.Text, "'", "''")
                If sceginspect Is Nothing Then
                    sceginspect = ""
                End If
                STREET_LOCATION_1_CD = Replace(cmb_loccd_1.Text, "'", "''")
                If STREET_LOCATION_1_CD Is Nothing Then
                    STREET_LOCATION_1_CD = ""
                End If
                STREET_LOCATION_2_CD = Replace(txt_loccd_2.Text, "'", "''")
                If STREET_LOCATION_2_CD Is Nothing Then
                    STREET_LOCATION_2_CD = ""
                End If
            End If
            'sql1 = "Insert into tbl_servicewo(file_id,file_name,file_type,add_streetno,add_prefix,add_prefix_2, add_streetname,add_suffix,street_suffix_cd,date_installed,city,pipe_size,pipe_type,pressure,size_of_main,type_of_main,depth_of_main,tested_with,tested_to,psig_for_minutes,installed_by_contractor,foreman,remark,PREMISE_NO,f_stub,f_inserted,f_retired,f_leak, f_split,pipe_condition,lenmtrtomain,sceginspect, f_relocate , f_replace, STREET_LOCATION_1_CD, STREET_LOCATION_2_CD ) values('" & Me.txt_fileid.Text.Trim & "','" & Me.txt_filedesc.Text & "','" & Me.cmb_formtype.Text & "','" & Me.txt_4_add1.Text & "','" & cmb_4_add2.Text & "', '" & cmb_4_add2_1.Text & "','" & cmb_4_add3.Text & "','" & cmb_4_add4_1.Text & "', '" & cmb_4_add4.Text & "','" & Me.txt_4_dated.Text & "','" & Me.cmb_4_city.Text & "','" & Replace(Me.cmb_4_pipesize.Text, "'", "''") & "','" & Replace(Me.cmb_4_pipekind.Text, "'", "''") & "','" & Me.cmb_4_pressure.Text & "','" & Replace(Me.cmb_4_mainsize.Text, "'", "''") & "','" & Me.cmb_4_maintype.Text & "','" & Me.txt_4_deptmain.Text & "','" & Me.cmb_4_testedwith.Text & "','" & Me.cmb_4_testedto.Text & "','" & Me.txt_4_psigmin.Text & "','" & Me.txt_4_installedby.Text & "','" & Me.txt_4_foreman.Text & "','" & Replace(Me.txt_4_remark.Text, "'", "''") & "','" & Me.txt_4_premiseno.Text & "', '" & chk_stub.Checked.ToString & "', '" & chk_inserted.Checked.ToString & "', '" & chk_retired.Checked.ToString & "' , '" & ckh_leak.Checked.ToString & "', '" & chk_split.Checked.ToString & "','" & Replace(Me.cmb_4_condition.Text, "'", "''") & "' ,'" & Replace(Me.txt_4_lenmtrtomain.Text, "'", "''") & "','" & Replace(Me.txt_4_sceginspect.Text, "'", "''") & "', '" & chk_relocate.Checked.ToString & "' , '" & chk_replace.Checked.ToString & "' ,'" & Replace(cmb_loccd_1.Text, "'", "''") & "' ,'" & Replace(txt_loccd_2.Text, "'", "''") & "' )"
            If Me.cmb_formtype.Text = "OD-9-6-38" Then
                file_name = Me.txt_filedesc.Text
                file_type = Me.cmb_formtype.Text
                add_streetno = Me.txt_5_add1.Text
                add_prefix = cmb_5_add2.Text
                add_prefix_2 = cmb_5_add2_1.Text
                add_streetname = cmb_5_add3.Text
                add_suffix = cmb_5_add4_1.Text
                street_suffix_cd = cmb_5_add4.Text
                date_installed = Me.txt_5_dated.Text
                city = Me.cmb_5_city.Text
                service_wo_no = Me.txt_5_serno.Text
                pipe_size = Replace(Me.cmb_5_pipesize.Text, "'", "''")
                If pipe_size Is Nothing Then
                    pipe_size = ""
                End If
                pipe_type = Me.cmb_5_pipekind.Text
                length_main_to_curb_valve_ft = Replace(Me.txt_5_ser_ft.Text, "'", "''")
                length_curb_valve_to_property_line_ft = Replace(Me.txt_5_depser_ft.Text, "'", "''")
                length_property_line_to_meter_ft = Replace(Me.txt_5_propln_ft.Text, "'", "''")
                remark = Replace(Me.txt_5_remark.Text, "'", "''")
                If remark Is Nothing Then
                    remark = ""
                End If
                PREMISE_NO = Me.txt_5_premiseno.Text
                f_stub = chk_stub.Checked.ToString
                f_inserted = chk_inserted.Checked.ToString
                f_retired = chk_retired.Checked.ToString
                f_leak = ckh_leak.Checked.ToString
                f_split = chk_split.Checked.ToString
                f_relocate = chk_relocate.Checked.ToString
                f_replace = chk_replace.Checked.ToString
                STREET_LOCATION_1_CD = Replace(cmb_loccd_1.Text, "'", "''")
                If STREET_LOCATION_1_CD Is Nothing Then
                    STREET_LOCATION_1_CD = ""
                End If
                STREET_LOCATION_2_CD = Replace(txt_loccd_2.Text, "'", "''")
                If STREET_LOCATION_2_CD Is Nothing Then
                    STREET_LOCATION_2_CD = ""
                End If
            End If
            'sql1 = "Insert into tbl_servicewo(file_id,file_name,file_type,add_streetno,add_prefix,add_prefix_2, add_streetname,add_suffix,street_suffix_cd,date_installed,city,service_wo_no,pipe_size,pipe_type,length_main_to_curb_valve_ft,length_curb_valve_to_property_line_ft,length_property_line_to_meter_ft,remark,PREMISE_NO,f_stub,f_inserted,f_retired,f_leak, f_split, f_relocate , f_replace, STREET_LOCATION_1_CD, STREET_LOCATION_2_CD ) values('" & Me.txt_fileid.Text.Trim & "','" & Me.txt_filedesc.Text & "','" & Me.cmb_formtype.Text & "','" & Me.txt_5_add1.Text & "','" & cmb_5_add2.Text & "', '" & cmb_5_add2_1.Text & "','" & cmb_5_add3.Text & "','" & cmb_5_add4_1.Text & "', '" & cmb_5_add4.Text & "','" & Me.txt_5_dated.Text & "','" & Me.cmb_5_city.Text & "','" & Me.txt_5_serno.Text & "','" & Replace(Me.cmb_5_pipesize.Text, "'", "''") & "','" & Replace(Me.cmb_5_pipekind.Text, "'", "''") & "','" & Replace(Me.txt_5_ser_ft.Text, "'", "''") & "','" & Replace(Me.txt_5_depser_ft.Text, "'", "''") & "','" & Replace(Me.txt_5_propln_ft.Text, "'", "''") & "','" & Replace(Me.txt_5_remark.Text, "'", "''") & "','" & Me.txt_5_premiseno.Text & "', '" & chk_stub.Checked.ToString & "', '" & chk_inserted.Checked.ToString & "', '" & chk_retired.Checked.ToString & "' , '" & ckh_leak.Checked.ToString & "', '" & chk_split.Checked.ToString & "', '" & chk_relocate.Checked.ToString & "' , '" & chk_replace.Checked.ToString & "' ,'" & Replace(cmb_loccd_1.Text, "'", "''") & "' ,'" & Replace(txt_loccd_2.Text, "'", "''") & "' )"
            If Me.cmb_formtype.Text = "Form-80I" Then
                file_name = Me.txt_filedesc.Text
                file_type = Me.cmb_formtype.Text
                add_streetno = Me.txt_6_add1.Text
                add_prefix = cmb_6_add2.Text
                add_prefix_2 = cmb_6_add2_1.Text
                add_streetname = cmb_6_add3.Text
                add_suffix = cmb_6_add4_1.Text
                street_suffix_cd = cmb_6_add4.Text
                date_installed = Me.txt_6_dated.Text
                city = Me.cmb_6_city.Text
                pipe_size = Replace(Me.cmb_6_pipesize.Text, "'", "''")
                If pipe_size Is Nothing Then
                    pipe_size = ""
                End If
                pipe_type = Me.cmb_6_pipekind.Text
                length_main_to_curb_valve_ft = Replace(Me.txt_6_ser_ft.Text, "'", "''")
                length_main_to_curb_valve_in = Replace(Me.txt_6_ser_in.Text, "'", "''")
                length_curb_valve_to_property_line_ft = Replace(Me.txt_6_depser_ft.Text, "'", "''")
                length_curb_valve_to_property_line_in = Replace(Me.txt_6_depser_in.Text, "'", "''")
                size_of_main = Replace(Me.cmb_6_mainsize.Text, "'", "''")
                If size_of_main Is Nothing Then
                    size_of_main = ""
                End If
                type_of_main = Replace(Me.cmb_6_maintype.Text, "'", "''")
                If type_of_main Is Nothing Then
                    type_of_main = ""
                End If
                depth_of_main = Me.txt_6_deptmain.Text
                tested_with = Me.cmb_6_testedwith.Text
                tested_to = Me.cmb_6_testedto.Text
                psig_for_minutes = Me.txt_6_psigmin.Text
                remark = Replace(Me.txt_6_remark.Text, "'", "''")
                If remark Is Nothing Then
                    remark = ""
                End If
                PREMISE_NO = Me.txt_6_premiseno.Text
                f_stub = chk_stub.Checked.ToString
                f_inserted = chk_inserted.Checked.ToString
                f_retired = chk_retired.Checked.ToString
                f_leak = ckh_leak.Checked.ToString
                f_split = chk_split.Checked.ToString
                f_relocate = chk_relocate.Checked.ToString
                f_replace = chk_replace.Checked.ToString
                lenmtrtomain = Replace(Me.txt_6_lenmtrtomain.Text, "'", "''")

                STREET_LOCATION_1_CD = Replace(cmb_loccd_1.Text, "'", "''")
                If STREET_LOCATION_1_CD Is Nothing Then
                    STREET_LOCATION_1_CD = ""
                End If
                STREET_LOCATION_2_CD = Replace(txt_loccd_2.Text, "'", "''")
                If STREET_LOCATION_2_CD Is Nothing Then
                    STREET_LOCATION_2_CD = ""
                End If
            End If
            'sql1 = "Insert into tbl_servicewo(file_id,file_name,file_type,add_streetno,add_prefix,add_prefix_2, add_streetname,add_suffix,street_suffix_cd,date_installed,city,pipe_size,pipe_type,length_main_to_curb_valve_ft,length_main_to_curb_valve_in,length_curb_valve_to_property_line_ft,length_curb_valve_to_property_line_in,size_of_main,type_of_main,depth_of_main,tested_with,tested_to,psig_for_minutes,remark,PREMISE_NO,f_stub,f_inserted,f_retired,f_leak, f_split,lenmtrtomain, f_relocate , f_replace, STREET_LOCATION_1_CD, STREET_LOCATION_2_CD ) values('" & Me.txt_fileid.Text.Trim & "','" & Me.txt_filedesc.Text & "','" & Me.cmb_formtype.Text & "','" & Me.txt_6_add1.Text & "','" & cmb_6_add2.Text & "', '" & cmb_6_add2_1.Text & "','" & cmb_6_add3.Text & "','" & cmb_6_add4_1.Text & "', '" & cmb_6_add4.Text & "','" & Me.txt_6_dated.Text & "','" & Me.cmb_6_city.Text & "','" & Replace(Me.cmb_6_pipesize.Text, "'", "''") & "','" & Replace(Me.cmb_6_pipekind.Text, "'", "''") & "','" & Replace(Me.txt_6_ser_ft.Text, "'", "''") & "','" & Replace(Me.txt_6_ser_in.Text, "'", "''") & "','" & Replace(Me.txt_6_depser_ft.Text, "'", "''") & "','" & Replace(Me.txt_6_depser_in.Text, "'", "''") & "','" & Replace(Me.cmb_6_mainsize.Text, "'", "''") & "','" & Me.cmb_6_maintype.Text & "','" & Me.txt_6_deptmain.Text & "','" & Me.cmb_6_testedwith.Text & "','" & Me.cmb_6_testedto.Text & "','" & Me.txt_6_psigmin.Text & "','" & Replace(Me.txt_6_remark.Text, "'", "''") & "','" & Me.txt_6_premiseno.Text & "', '" & chk_stub.Checked.ToString & "', '" & chk_inserted.Checked.ToString & "', '" & chk_retired.Checked.ToString & "' , '" & ckh_leak.Checked.ToString & "', '" & chk_split.Checked.ToString & "','" & Replace(Me.txt_6_lenmtrtomain.Text, "'", "''") & "', '" & chk_relocate.Checked.ToString & "' , '" & chk_replace.Checked.ToString & "' ,'" & Replace(cmb_loccd_1.Text, "'", "''") & "' ,'" & Replace(txt_loccd_2.Text, "'", "''") & "' )"
            If cmb_formtype.Text.Trim = "ABANDON-I" Then
                file_name = Me.txt_filedesc.Text
                file_type = Me.cmb_formtype.Text
                add_streetno = Me.txt_8_add1.Text
                add_prefix = cmb_8_add2.Text
                add_prefix_2 = cmb_8_add2_1.Text
                add_streetname = cmb_8_add3.Text
                add_suffix = cmb_8_add4_1.Text
                street_suffix_cd = cmb_8_add4.Text
                date_installed = Me.txt_8_dated.Text
                city = Me.cmb_8_city.Text
                size_of_main = Replace(Me.cmb_8_mainsize.Text, "'", "''")
                If size_of_main Is Nothing Then
                    size_of_main = ""
                End If
                type_of_main = Replace(Me.cmb_8_maintype.Text, "'", "''")
                If type_of_main Is Nothing Then
                    type_of_main = ""
                End If
                remark = Replace(Me.txt_8_remark.Text, "'", "''")
                If remark Is Nothing Then
                    remark = ""
                End If
                PREMISE_NO = Me.txt_8_premiseno.Text
                f_stub = chk_stub.Checked.ToString
                f_inserted = chk_inserted.Checked.ToString
                f_retired = chk_retired.Checked.ToString
                f_leak = ckh_leak.Checked.ToString
                f_split = chk_split.Checked.ToString
                f_relocate = chk_relocate.Checked.ToString
                f_replace = chk_replace.Checked.ToString
                DATE_ABANDON = Me.txt_8_dateabandon.Text
                type_coating = Replace(cmb_8_coating.Text, "'", "''")
                If type_coating Is Nothing Then
                    type_coating = ""
                End If
                STREET_LOCATION_1_CD = Replace(cmb_loccd_1.Text, "'", "''")
                If STREET_LOCATION_1_CD Is Nothing Then
                    STREET_LOCATION_1_CD = ""
                End If
                STREET_LOCATION_2_CD = Replace(txt_loccd_2.Text, "'", "''")
                If STREET_LOCATION_2_CD Is Nothing Then
                    STREET_LOCATION_2_CD = ""
                End If
            End If
            ' sql1 = "update tbl_servicewo set file_name = '" & Me.txt_filedesc.Text & "',file_type='" & Me.cmb_formtype.Text & "',add_streetno = '" & Me.txt_8_add1.Text & "',add_prefix = '" & cmb_8_add2.Text & "',add_prefix_2 = '" & cmb_8_add2_1.Text & "',add_streetname = '" & cmb_8_add3.Text & "',add_suffix = '" & cmb_8_add4_1.Text & "', street_suffix_cd = '" & cmb_8_add4.Text & "',  date_installed = '" & Me.txt_8_dated.Text & "', city= '" & Me.cmb_8_city.Text & "',   size_of_main = '" & Replace(Me.cmb_8_mainsize.Text, "'", "''") & "',type_of_main = '" & Replace(Me.cmb_8_maintype.Text, "'", "''") & "', remark = '" & Replace(Me.txt_8_remark.Text, "'", "''") & "' , PREMISE_NO = '" & Me.txt_8_premiseno.Text & "' , f_stub = '" & chk_stub.Checked.ToString & "' , f_inserted = '" & chk_inserted.Checked.ToString & "' , f_retired = '" & chk_retired.Checked.ToString & "', f_leak = '" & ckh_leak.Checked.ToString & "' ,  f_split = '" & chk_split.Checked.ToString & "' , f_relocate = '" & chk_relocate.Checked.ToString & "' , f_replace = '" & chk_replace.Checked.ToString & "' , DATE_ABANDON = '" & Me.txt_8_dateabandon.Text & "',type_coating	 = '" & Replace(cmb_8_coating.Text, "'", "''") & "' , STREET_LOCATION_1_CD = '" & Replace(cmb_loccd_1.Text, "'", "''") & "' , STREET_LOCATION_2_CD  = '" & Replace(txt_loccd_2.Text, "'", "''") & "' where file_id = '" & Me.txt_fileid.Text.Trim & "'"
            'End If
            Dim cmd As New SqlCommand(sql1, conn)
            cmd.CommandType = CommandType.StoredProcedure
            cmd.Parameters.AddWithValue("@file_id", file_id)
            cmd.Parameters.AddWithValue("@file_name", file_name)
            cmd.Parameters.AddWithValue("@file_type", file_type)
            cmd.Parameters.AddWithValue("@add_streetno", add_streetno)
            cmd.Parameters.AddWithValue("@add_prefix", add_prefix)
            cmd.Parameters.AddWithValue("@add_prefix_2", add_prefix_2)
            cmd.Parameters.AddWithValue("@add_streetname", add_streetname)
            cmd.Parameters.AddWithValue("@add_suffix", add_suffix)
            cmd.Parameters.AddWithValue("@street_suffix_cd", street_suffix_cd)
            cmd.Parameters.AddWithValue("@name", name)
            cmd.Parameters.AddWithValue("@date_installed", date_installed)
            cmd.Parameters.AddWithValue("@city", city)
            cmd.Parameters.AddWithValue("@subdivision", subdivision)
            cmd.Parameters.AddWithValue("@service_wo_no", service_wo_no)
            cmd.Parameters.AddWithValue("@pipe_size", pipe_size)
            cmd.Parameters.AddWithValue("@pipe_type", pipe_type)
            cmd.Parameters.AddWithValue("@pressure", pressure)
            cmd.Parameters.AddWithValue("@size_of_tap", size_of_tap)
            cmd.Parameters.AddWithValue("@length_main_to_curb_valve_ft", length_main_to_curb_valve_ft)
            cmd.Parameters.AddWithValue("@length_main_to_curb_valve_in", length_main_to_curb_valve_in)
            cmd.Parameters.AddWithValue("@length_curb_valve_to_property_line_ft", length_curb_valve_to_property_line_ft)
            cmd.Parameters.AddWithValue("@length_curb_valve_to_property_line_in", length_curb_valve_to_property_line_in)
            cmd.Parameters.AddWithValue("@length_main_to_property_line_ft", length_main_to_property_line_ft)
            cmd.Parameters.AddWithValue("@length_main_to_property_line_in", length_main_to_property_line_in)
            cmd.Parameters.AddWithValue("@length_property_line_to_meter_ft", length_property_line_to_meter_ft)
            cmd.Parameters.AddWithValue("@length_property_line_to_meter_in", length_property_line_to_meter_in)
            cmd.Parameters.AddWithValue("@size_of_main", size_of_main)
            cmd.Parameters.AddWithValue("@type_of_main", type_of_main)
            cmd.Parameters.AddWithValue("@depth_of_main", depth_of_main)
            cmd.Parameters.AddWithValue("@tested_with", tested_with)
            cmd.Parameters.AddWithValue("@tested_to", tested_to)
            cmd.Parameters.AddWithValue("@psig_for_minutes", psig_for_minutes)
            cmd.Parameters.AddWithValue("@installed_by_contractor", installed_by_contractor)
            cmd.Parameters.AddWithValue("@foreman", foreman)
            cmd.Parameters.AddWithValue("@remark", remark)
            cmd.Parameters.AddWithValue("@PREMISE_NO", PREMISE_NO)
            cmd.Parameters.AddWithValue("@f_stub", f_stub)
            cmd.Parameters.AddWithValue("@f_inserted", f_inserted)
            cmd.Parameters.AddWithValue("@f_retired", f_retired)
            cmd.Parameters.AddWithValue("@f_leak", f_leak)
            cmd.Parameters.AddWithValue("@f_split", f_split)
            cmd.Parameters.AddWithValue("@pipe_condition", pipe_condition)
            cmd.Parameters.AddWithValue("@lenmtrtomain", lenmtrtomain)
            cmd.Parameters.AddWithValue("@sceginspect", sceginspect)
            cmd.Parameters.AddWithValue("@nature_of_work", nature_of_work)
            cmd.Parameters.AddWithValue("@kind_of_joint", kind_of_joint)
            cmd.Parameters.AddWithValue("@split_sleeve", split_sleeve)
            cmd.Parameters.AddWithValue("@loc_of_cock", loc_of_cock)
            cmd.Parameters.AddWithValue("@kind_of_box", kind_of_box)
            cmd.Parameters.AddWithValue("@type_coating", type_coating)
            cmd.Parameters.AddWithValue("@DATE_ABANDON", DATE_ABANDON)
            cmd.Parameters.AddWithValue("@reason_of_abandon", reason_of_abandon)
            cmd.Parameters.AddWithValue("@f_noblow", f_noblow)
            cmd.Parameters.AddWithValue("@f_gassource", f_gassource)
            cmd.Parameters.AddWithValue("@f_tappingtee", f_tappingtee)
            cmd.Parameters.AddWithValue("@f_linesealed", f_linesealed)
            cmd.Parameters.AddWithValue("@f_defcoatcor", f_defcoatcor)
            cmd.Parameters.AddWithValue("@f_multimeter", f_multimeter)
            cmd.Parameters.AddWithValue("@f_serstop", f_serstop)
            cmd.Parameters.AddWithValue("@f_cathodpro", f_cathodpro)
            cmd.Parameters.AddWithValue("@f_tee", f_tee)
            cmd.Parameters.AddWithValue("@f_taptee", f_taptee)
            cmd.Parameters.AddWithValue("@f_galvanized", f_galvanized)
            cmd.Parameters.AddWithValue("@tap_t_size", tap_t_size)
            cmd.Parameters.AddWithValue("@tap_t_inlet", tap_t_inlet)
            cmd.Parameters.AddWithValue("@tap_t_outlet", tap_t_outlet)
            cmd.Parameters.AddWithValue("@f_insulated", f_insulated)
            cmd.Parameters.AddWithValue("@f_anoderiser", f_anoderiser)
            cmd.Parameters.AddWithValue("@otheranode_lbs", otheranode_lbs)
            cmd.Parameters.AddWithValue("@connection_data", connection_data)
            cmd.Parameters.AddWithValue("@misc_card_type", misc_card_type)
            cmd.Parameters.AddWithValue("@f_relocate", f_relocate)
            cmd.Parameters.AddWithValue("@f_replace", f_replace)
            cmd.Parameters.AddWithValue("@STREET_LOCATION_1_CD", STREET_LOCATION_1_CD)
            cmd.Parameters.AddWithValue("@STREET_LOCATION_2_CD", STREET_LOCATION_2_CD)

            'Update 100BLK
            cmd.Parameters.AddWithValue("@main_year_installed", main_installed_year)
            cmd.Parameters.AddWithValue("@a_ps_reading", a_ps_reading)
            cmd.Parameters.AddWithValue("@total_anodes_1", tot_anodes_1)
            cmd.Parameters.AddWithValue("@total_anodes_17", tot_anodes_17)
            cmd.Parameters.AddWithValue("@lr", lr)
            cmd.Parameters.AddWithValue("@inches_wc", inches_wc)
            'Update 200BLK
            cmd.Parameters.AddWithValue("@RetiredSize", RetiredSize)
            cmd.Parameters.AddWithValue("@UnitsRetired", UnitsRetired)
            cmd.Parameters.AddWithValue("@LengthRetired", LengthRetired)
            cmd.Parameters.AddWithValue("@RetiredQty", RetiredQty)
            cmd.Parameters.AddWithValue("@2LbSystem", LbSystem)

            cmd.ExecuteNonQuery()
            update_fileid_status(Me.txt_fileid.Text.Trim)


            'Next record
            If (getnext_fileid(CInt(Me.txt_fileid.Text.Trim)) > 0) Then
                getfiledetail(getnext_fileid(CInt(Me.txt_fileid.Text.Trim)))
            Else
                MsgBox("No More image files available.", MsgBoxStyle.Information, "Next Image")
            End If


        End If
        If conn.State = ConnectionState.Open Then
            conn.Close()
        End If
    End Sub
    Private Sub update_fileid_status(ByVal file_id As String)
        Dim sts As String
        If rbt_qa.Checked = True Then
            sts = "C"
        Else
            sts = "C"
        End If
        Try
            Dim cmd As New SqlCommand("SO_FrmQaUpdatefileid", conn)
            cmd.CommandType = CommandType.StoredProcedure
            cmd.Parameters.AddWithValue("@lastremark", txt_passcomment.Text.Trim)
            cmd.Parameters.AddWithValue("@qaverfiedby", commonUser.Common.uID)
            cmd.Parameters.AddWithValue("@fileid", file_id)
            'Dim cmd As New SqlCommand("update tbl_parent set status = '" & sts & "' , qa_verify_date = getdate() , last_remark = '" & txt_passcomment.Text.Trim & "', qa_verify_by = " & commonUser.Common.uID & " where file_id = " & file_id & "", conn)
            cmd.ExecuteNonQuery()
            'MsgBox("User Added Successfully!!", MsgBoxStyle.Information, "User Added")
            'btn_Update.Text = "Update"
        Catch ex As Exception
        End Try
        If rbt_qa.Checked = True Then
            ' mark_passed(Me.txt_fileid.Text.Trim)
        End If


    End Sub
    Private Sub btn_reset_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_reset.Click
        Dim a As DialogResult = MsgBox("Are you sure to reset the record?", MsgBoxStyle.OkCancel, "Data Entry")
        If a = Windows.Forms.DialogResult.Cancel Then Exit Sub

        If btn_submit.Text.Trim = "SUBMIT" Then
            resetfiledata()
        ElseIf btn_submit.Text.Trim = "UPDATE" Then
            getfiledata(CInt(Me.txt_fileid.Text.Trim))
        End If
    End Sub
    Private Sub btn_pass_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_pass.Click
        Dim a As DialogResult = MsgBox("Are you sure, you want to pass the record to Client?", MsgBoxStyle.OkCancel, "Data Check")
        If a = Windows.Forms.DialogResult.Cancel Then Exit Sub
        If conn.State = ConnectionState.Closed Then
            conn.Open()
        End If
        Try
            Dim cmd As New SqlCommand("SO_FrmQaPass", conn)
            cmd.CommandType = CommandType.StoredProcedure

            cmd.Parameters.AddWithValue("@qaverfiedby", commonUser.Common.uID)
            cmd.Parameters.AddWithValue("@lastremark", txt_passcomment.Text.Trim)
            cmd.Parameters.AddWithValue("@fileid", Me.txt_fileid.Text.Trim)
            'Dim cmd As New SqlCommand("update tbl_parent set status = 'X' , qa_verify_date = getdate() ,  qa_verify_by = " & commonUser.Common.uID & ", last_remark = '" & Me.txt_passcomment.Text.Trim & "' where file_id = " & Me.txt_fileid.Text.Trim & "", conn)
            cmd.ExecuteNonQuery()
            'btn_Update.Text = "Update"
        Catch ex As Exception
        Finally
            If conn.State = ConnectionState.Open Then
                conn.Close()
            End If
        End Try
        If (getnext_fileid(CInt(Me.txt_fileid.Text.Trim)) > 0) Then
            getfiledetail(getnext_fileid(CInt(Me.txt_fileid.Text.Trim)))
        Else
            MsgBox("No More image files available.", MsgBoxStyle.Information, "Next Image")
        End If
    End Sub
    Private Sub rbt_verify_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rbt_verify.CheckedChanged, rbt_qa.CheckedChanged, radbtnmissmatch.CheckedChanged
        If rbt_qa.Checked = True Then
            lbl_incre.Visible = True
            txt_increment.Visible = True

        Else
            'Label62.Visible = False
            'txtreassignshow.Visible = False
            lbl_incre.Visible = False
            txt_increment.Visible = False
        End If
        getfiledetail(getminfile_forQAnCheck())
    End Sub
    Private Sub btn_verified_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_verified.Click
        Dim a As DialogResult = MsgBox("Are you sure, Data is found to be correct?", MsgBoxStyle.OkCancel, "Data Check")
        If a = Windows.Forms.DialogResult.Cancel Then Exit Sub
        If conn.State = ConnectionState.Closed Then
            conn.Open()
        End If
        Dim sts As String
        If rbt_qa.Checked = True Then
            sts = "Q"
        Else
            sts = "V"
        End If
        Try
            Dim cmd As New SqlCommand("SO_FrmQaVerified", conn)
            cmd.CommandType = CommandType.StoredProcedure
            cmd.Parameters.AddWithValue("@status", sts)
            cmd.Parameters.AddWithValue("@qaverfiedby", commonUser.Common.uID)
            cmd.Parameters.AddWithValue("@fileid", Me.txt_fileid.Text.Trim)
            ' Dim cmd As New SqlCommand("update tbl_parent set status = '" & sts & "' , qa_verify_date = getdate() ,  qa_verify_by = " & commonUser.Common.uID & " where file_id = " & Me.txt_fileid.Text.Trim & "", conn)
            cmd.ExecuteNonQuery()
            ' MsgBox("User Added Successfully!!", MsgBoxStyle.Information, "User Added")
            'btn_Update.Text = "Update"
        Catch ex As Exception
        End Try

        If rbt_qa.Checked = True Then
            'mark_passed(Me.txt_fileid.Text.Trim)
        End If
        'Next record
        If (getnext_fileid(CInt(Me.txt_fileid.Text.Trim)) > 0) Then
            getfiledetail(getnext_fileid(CInt(Me.txt_fileid.Text.Trim)))
        Else
            MsgBox("No More image files available.", MsgBoxStyle.Information, "Next Image")
        End If
        If conn.State = ConnectionState.Open Then
            conn.Close()
        End If
    End Sub
    Private Sub mark_passed(ByVal fileid As String)

        If conn.State = ConnectionState.Closed Then
            conn.Open()
        End If
        Try
            Dim cmd As New SqlCommand("SO_FrmQaMarkPassed", conn)
            cmd.CommandType = CommandType.StoredProcedure
            cmd.Parameters.AddWithValue("@fileid", Me.txt_fileid.Text.Trim)
            'Dim cmd As New SqlCommand("update tbl_parent set status = 'U'  where status = 'E' and file_id < " & Me.txt_fileid.Text.Trim & "", conn)
            cmd.ExecuteNonQuery()

        Catch ex As Exception
        End Try

        If conn.State = ConnectionState.Open Then
            conn.Close()
        End If
    End Sub

    Private Sub cmb_w_add4_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_w_add4.Leave
        Me.txt_w_premiseno.Text = Me.get_premiseno(Me.txt_w_add1.Text.Trim, cmb_w_add2.Text.Trim, cmb_w_add2_1.Text.Trim, cmb_w_add3.Text.Trim, cmb_w_add4.Text.Trim)
    End Sub
    Private Sub txt_y_add1_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs)
        'Fill_Streetname(Me.cmb_y_add3, Me.txt_y_add1.Text.Trim, cmb_y_add2.Text.Trim, cmb_y_add2_1.Text.Trim)

    End Sub
    Private Sub cmb_w_add3_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_w_add3.Enter
        Fill_Streetname(Me.cmb_w_add3, Me.txt_w_add1.Text.Trim, cmb_w_add2.Text.Trim, Me.cmb_w_add2_1.Text.Trim)
    End Sub
    Private Sub cmb_w_add3_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_w_add3.Leave, cmb_w_add4_1.Leave
        Me.Fill_Streetprefix(Me.cmb_w_add4, Me.txt_w_add1.Text.Trim, cmb_w_add2.Text.Trim, cmb_w_add2_1.Text.Trim, cmb_w_add3.Text.Trim, cmb_w_add4_1.Text.Trim)
    End Sub
    Private Sub cmb_y_add3_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_y_add3.Leave
        Me.Fill_Streetprefix(Me.cmb_y_add4, Me.txt_y_add1.Text.Trim, cmb_y_add2.Text.Trim, cmb_y_add2_1.Text.Trim, cmb_y_add3.Text.Trim, cmb_w_add4_1.Text.Trim)
    End Sub
    Private Sub cmb_y_add3_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_y_add3.Enter
        Fill_Streetname(Me.cmb_y_add3, Me.txt_y_add1.Text.Trim, cmb_y_add2.Text.Trim, cmb_y_add2_1.Text.Trim)

    End Sub

    Private Sub cmb_y_add4_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_y_add4.Leave
        Me.txt_y_premiseno.Text = Me.get_premiseno(Me.txt_y_add1.Text.Trim, Me.cmb_y_add2.Text.Trim, cmb_y_add2_1.Text.Trim, cmb_y_add3.Text.Trim, cmb_y_add4.Text.Trim)

    End Sub

    Private Sub cmb_y_add4_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_y_add4.Enter
        Me.Fill_Streetprefix(Me.cmb_y_add4, Me.txt_y_add1.Text.Trim, Me.cmb_y_add2.Text.Trim, cmb_y_add2_1.Text.Trim, cmb_y_add3.Text.Trim, cmb_y_add4_1.Text.Trim)

    End Sub

    Private Sub cmb_w_add4_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_w_add4.Enter
        Me.Fill_Streetprefix(Me.cmb_w_add4, Me.txt_w_add1.Text.Trim, cmb_w_add2.Text.Trim, cmb_w_add2_1.Text.Trim, cmb_w_add3.Text.Trim, cmb_w_add4_1.Text.Trim)

    End Sub
    Private Sub cmb_w_add2_1_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_w_add2_1.Leave, cmb_w_add2.Leave
        Fill_Streetname(Me.cmb_w_add3, Me.txt_w_add1.Text.Trim, Me.cmb_w_add2.Text.Trim, cmb_w_add2_1.Text.Trim)
    End Sub
    Private Sub cmb_y_add2_1_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_y_add2_1.Leave, cmb_y_add2.Leave
        'Fill_Streetname(Me.cmb_y_add3, Me.txt_y_add1.Text.Trim, cmb_y_add2.Text.Trim, cmb_y_add2_1.Text.Trim)
    End Sub
    Private Sub cmb_y_add4_1_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_y_add4_1.Leave
        Me.Fill_Streetprefix(Me.cmb_y_add4, Me.txt_y_add1.Text.Trim, cmb_y_add2.Text.Trim, cmb_y_add2_1.Text.Trim, cmb_y_add3.Text.Trim, cmb_y_add4_1.Text.Trim)
    End Sub
    Private Sub btn_quckview_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_quckview.Click

        commonUser.Common.imageid = txt_fileid.Text.Trim
        Dim newquickview As New frm_quickview()
        newquickview.ShowDialog()
        newquickview.BringToFront()
        newquickview.Focus()
    End Sub
    Private Sub btn_flip_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_flip.Click, btn_flip2.Click
        If conn.State = 0 Then
            conn.Open()
        End If
        Dim file_desc As String
        file_desc = Me.txt_filedesc.Text.Trim
        'Dim dr As SqlDataReader = Nothing
        'cmd = New SqlCommand("select replace(substring(externalref,charindex('Page',externalref),25),'.tif','.pdf') as externalref from tbl_so_imagefiles where service_order = (select service_order from tbl_parent where file_id = " & Me.txt_fileid.Text.Trim & " ) and substring(externalref,charindex('Page',externalref),25) <> replace('" & file_desc & "','.pdf','.tif')", conn)
        'dr = cmd.ExecuteReader(CommandBehavior.CloseConnection)
        'If (dr.Read) Then
        '    btn_flip.Enabled = True
        '    btn_flip2.Enabled = True
        '    AxPdf1.LoadFile(im_loc & dr(0).ToString)
        '    txt_filedesc.Text = dr(0).ToString
        'End If


        Dim dr As SqlDataReader = Nothing
        Dim cmd As New SqlCommand("SO_FrmQaFlip", conn)
        cmd.CommandType = CommandType.StoredProcedure
        cmd.Parameters.AddWithValue("@imagelocation", im_location)
        cmd.Parameters.AddWithValue("@fileid", Me.txt_fileid.Text.Trim)
        cmd.Parameters.AddWithValue("@filedesc", file_desc)
        'cmd = New SqlCommand("select replace(substring(externalref,charindex('Page',externalref),25),'.tif','.pdf') as externalref1, replace(replace(replace(externalref,'.tif','.pdf'),'C:\export test\','" & im_location & "'), '\\scana\shares\apps\apps\filenet\efi\Gas Project Files\','" & im_location & "') as externalref from tbl_so_imagefiles where service_order = (select service_order from tbl_parent where file_id = " & Me.txt_fileid.Text.Trim & " ) and substring(externalref,charindex('Page',externalref),25) <> replace('" & file_desc & "','.pdf','.tif')", conn)
        dr = cmd.ExecuteReader(CommandBehavior.CloseConnection)
        If (dr.Read) Then
            btn_flip.Enabled = True
            btn_flip2.Enabled = True
            AxPdf1.LoadFile(dr(1).ToString)
            txt_filedesc.Text = dr(0).ToString
        End If

        dr.Close()
        If conn.State = ConnectionState.Open Then
            conn.Close()
        End If
    End Sub
    Private Sub cmb_3_add2_1_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_3_add2_1.Leave
        Fill_Streetname(Me.cmb_3_add3, Me.txt_3_add1.Text.Trim, cmb_3_add2.Text.Trim, cmb_3_add2_1.Text.Trim)
    End Sub
    Private Sub cmb_3_add3_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_3_add3.Enter
        Fill_Streetname(Me.cmb_3_add3, Me.txt_3_add1.Text.Trim, cmb_3_add2.Text.Trim, cmb_3_add2_1.Text.Trim)
    End Sub
    Private Sub cmb_3_add3_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_3_add3.Leave
        Me.Fill_Streetprefix(Me.cmb_3_add4, Me.txt_3_add1.Text.Trim, cmb_3_add2.Text.Trim, cmb_3_add2_1.Text.Trim, cmb_3_add3.Text.Trim, cmb_3_add4_1.Text.Trim)
    End Sub
    Private Sub cmb_3_add4_1_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_3_add4_1.Leave
        Me.Fill_Streetprefix(Me.cmb_3_add4, Me.txt_3_add1.Text.Trim, cmb_3_add2.Text.Trim, cmb_3_add2_1.Text.Trim, cmb_3_add3.Text.Trim, cmb_3_add4_1.Text.Trim)
    End Sub
    Private Sub cmb_3_add4_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_3_add4.Enter
        Me.Fill_Streetprefix(Me.cmb_3_add4, Me.txt_3_add1.Text.Trim, Me.cmb_3_add2.Text.Trim, cmb_3_add2_1.Text.Trim, cmb_3_add3.Text.Trim, cmb_3_add4_1.Text.Trim)
    End Sub
    Private Sub cmb_3_add4_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_3_add4.Leave
        Me.txt_3_premiseno.Text = Me.get_premiseno(Me.txt_3_add1.Text.Trim, Me.cmb_3_add2.Text.Trim, cmb_3_add2_1.Text.Trim, cmb_3_add3.Text.Trim, cmb_3_add4.Text.Trim)
    End Sub
    Private Sub cmb_4_add2_1_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_4_add2_1.Leave
        Fill_Streetname(Me.cmb_4_add3, Me.txt_4_add1.Text.Trim, cmb_4_add2.Text.Trim, cmb_4_add2_1.Text.Trim)
    End Sub
    Private Sub cmb_4_add3_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_4_add3.Enter
        Fill_Streetname(Me.cmb_4_add3, Me.txt_4_add1.Text.Trim, cmb_4_add2.Text.Trim, cmb_4_add2_1.Text.Trim)
    End Sub
    Private Sub cmb_4_add3_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_4_add3.Leave
        Me.Fill_Streetprefix(Me.cmb_4_add4, Me.txt_4_add1.Text.Trim, cmb_4_add2.Text.Trim, cmb_4_add2_1.Text.Trim, cmb_4_add3.Text.Trim, cmb_4_add4_1.Text.Trim)
    End Sub
    Private Sub cmb_4_add4_1_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_4_add4_1.Leave
        Me.Fill_Streetprefix(Me.cmb_4_add4, Me.txt_4_add1.Text.Trim, cmb_4_add2.Text.Trim, cmb_4_add2_1.Text.Trim, cmb_4_add3.Text.Trim, cmb_4_add4_1.Text.Trim)
    End Sub

    Private Sub cmb_4_add4_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_4_add4.Enter
        Me.Fill_Streetprefix(Me.cmb_4_add4, Me.txt_4_add1.Text.Trim, Me.cmb_4_add2.Text.Trim, cmb_4_add2_1.Text.Trim, cmb_4_add3.Text.Trim, cmb_4_add4_1.Text.Trim)

    End Sub

    Private Sub cmb_4_add4_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_4_add4.Leave
        Me.txt_4_premiseno.Text = Me.get_premiseno(Me.txt_4_add1.Text.Trim, Me.cmb_4_add2.Text.Trim, cmb_4_add2_1.Text.Trim, cmb_4_add3.Text.Trim, cmb_4_add4.Text.Trim)
    End Sub

    Private Sub cmb_5_add2_1_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_5_add2_1.Leave
        Fill_Streetname(Me.cmb_5_add3, Me.txt_5_add1.Text.Trim, cmb_5_add2.Text.Trim, cmb_5_add2_1.Text.Trim)
    End Sub

    Private Sub cmb_5_add3_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_5_add3.Enter
        Fill_Streetname(Me.cmb_5_add3, Me.txt_5_add1.Text.Trim, cmb_5_add2.Text.Trim, cmb_5_add2_1.Text.Trim)
    End Sub

    Private Sub cmb_5_add3_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_5_add3.Leave
        Me.Fill_Streetprefix(Me.cmb_5_add4, Me.txt_5_add1.Text.Trim, cmb_5_add2.Text.Trim, cmb_5_add2_1.Text.Trim, cmb_5_add3.Text.Trim, cmb_5_add4_1.Text.Trim)
    End Sub

    Private Sub cmb_5_add4_1_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_5_add4_1.Leave
        Me.Fill_Streetprefix(Me.cmb_5_add4, Me.txt_5_add1.Text.Trim, cmb_5_add2.Text.Trim, cmb_5_add2_1.Text.Trim, cmb_5_add3.Text.Trim, cmb_5_add4_1.Text.Trim)
    End Sub

    Private Sub cmb_5_add4_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_5_add4.Enter
        Me.Fill_Streetprefix(Me.cmb_5_add4, Me.txt_5_add1.Text.Trim, Me.cmb_5_add2.Text.Trim, cmb_5_add2_1.Text.Trim, cmb_5_add3.Text.Trim, cmb_5_add4_1.Text.Trim)
    End Sub

    Private Sub cmb_5_add4_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_5_add4.Leave
        Me.txt_5_premiseno.Text = Me.get_premiseno(Me.txt_5_add1.Text.Trim, Me.cmb_5_add2.Text.Trim, cmb_5_add2_1.Text.Trim, cmb_5_add3.Text.Trim, cmb_5_add4.Text.Trim)
    End Sub

    Private Sub cmb_6_add2_1_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_6_add2_1.Leave
        Fill_Streetname(Me.cmb_6_add3, Me.txt_6_add1.Text.Trim, cmb_6_add2.Text.Trim, cmb_6_add2_1.Text.Trim)
    End Sub

    Private Sub cmb_6_add3_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_6_add3.Enter
        Fill_Streetname(Me.cmb_6_add3, Me.txt_6_add1.Text.Trim, cmb_6_add2.Text.Trim, cmb_6_add2_1.Text.Trim)
    End Sub

    Private Sub cmb_6_add3_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_6_add3.Leave
        Me.Fill_Streetprefix(Me.cmb_6_add4, Me.txt_6_add1.Text.Trim, cmb_6_add2.Text.Trim, cmb_6_add2_1.Text.Trim, cmb_6_add3.Text.Trim, cmb_6_add4_1.Text.Trim)
    End Sub

    Private Sub cmb_6_add4_1_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_6_add4_1.Leave
        Me.Fill_Streetprefix(Me.cmb_6_add4, Me.txt_6_add1.Text.Trim, cmb_6_add2.Text.Trim, cmb_6_add2_1.Text.Trim, cmb_6_add3.Text.Trim, cmb_6_add4_1.Text.Trim)
    End Sub

    Private Sub cmb_6_add4_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_6_add4.Enter
        Me.Fill_Streetprefix(Me.cmb_6_add4, Me.txt_6_add1.Text.Trim, Me.cmb_6_add2.Text.Trim, cmb_6_add2_1.Text.Trim, cmb_6_add3.Text.Trim, cmb_6_add4_1.Text.Trim)
    End Sub

    Private Sub cmb_6_add4_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_6_add4.Leave
        Me.txt_6_premiseno.Text = Me.get_premiseno(Me.txt_6_add1.Text.Trim, Me.cmb_6_add2.Text.Trim, cmb_6_add2_1.Text.Trim, cmb_6_add3.Text.Trim, cmb_6_add4.Text.Trim)
    End Sub

    Private Sub cmb_7_add2_1_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_7_add2_1.Leave
        Fill_Streetname(Me.cmb_7_add3, Me.txt_7_add1.Text.Trim, cmb_7_add2.Text.Trim, cmb_7_add2_1.Text.Trim)
    End Sub

    Private Sub cmb_7_add3_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_7_add3.Enter
        Fill_Streetname(Me.cmb_7_add3, Me.txt_7_add1.Text.Trim, cmb_7_add2.Text.Trim, cmb_7_add2_1.Text.Trim)
    End Sub

    Private Sub cmb_7_add3_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_7_add3.Leave
        Me.Fill_Streetprefix(Me.cmb_7_add4, Me.txt_7_add1.Text.Trim, cmb_7_add2.Text.Trim, cmb_7_add2_1.Text.Trim, cmb_7_add3.Text.Trim, cmb_7_add4_1.Text.Trim)
    End Sub

    Private Sub cmb_7_add4_1_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_7_add4_1.Leave
        Me.Fill_Streetprefix(Me.cmb_7_add4, Me.txt_7_add1.Text.Trim, cmb_7_add2.Text.Trim, cmb_7_add2_1.Text.Trim, cmb_7_add3.Text.Trim, cmb_7_add4_1.Text.Trim)
    End Sub

    Private Sub cmb_7_add4_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_7_add4.Enter
        Me.Fill_Streetprefix(Me.cmb_7_add4, Me.txt_7_add1.Text.Trim, Me.cmb_7_add2.Text.Trim, cmb_7_add2_1.Text.Trim, cmb_7_add3.Text.Trim, cmb_7_add4_1.Text.Trim)
    End Sub

    Private Sub cmb_7_add4_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_7_add4.Leave
        Me.txt_7_premiseno.Text = Me.get_premiseno(Me.txt_7_add1.Text.Trim, Me.cmb_7_add2.Text.Trim, cmb_7_add2_1.Text.Trim, cmb_7_add3.Text.Trim, cmb_7_add4.Text.Trim)
    End Sub

    Private Sub cmb_8_add4_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_8_add4.Enter
        Me.Fill_Streetprefix(Me.cmb_8_add4, Me.txt_8_add1.Text.Trim, Me.cmb_8_add2.Text.Trim, cmb_8_add2_1.Text.Trim, cmb_8_add3.Text.Trim, cmb_8_add4_1.Text.Trim)
    End Sub

    Private Sub cmb_8_add4_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_8_add4.Leave
        Me.txt_8_premiseno.Text = Me.get_premiseno(Me.txt_8_add1.Text.Trim, Me.cmb_8_add2.Text.Trim, cmb_8_add2_1.Text.Trim, cmb_8_add3.Text.Trim, cmb_8_add4.Text.Trim)
    End Sub

    Private Sub cmb_8_add4_1_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_8_add4_1.Leave
        Me.Fill_Streetprefix(Me.cmb_8_add4, Me.txt_8_add1.Text.Trim, cmb_8_add2.Text.Trim, cmb_8_add2_1.Text.Trim, cmb_8_add3.Text.Trim, cmb_8_add4_1.Text.Trim)
    End Sub

    Private Sub cmb_8_add3_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_8_add3.Enter
        Fill_Streetname(Me.cmb_8_add3, Me.txt_8_add1.Text.Trim, cmb_8_add2.Text.Trim, cmb_8_add2_1.Text.Trim)
    End Sub

    Private Sub cmb_8_add3_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_8_add3.Leave
        Me.Fill_Streetprefix(Me.cmb_8_add4, Me.txt_8_add1.Text.Trim, cmb_8_add2.Text.Trim, cmb_8_add2_1.Text.Trim, cmb_8_add3.Text.Trim, cmb_8_add4_1.Text.Trim)
    End Sub

    Private Sub cmb_8_add2_1_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_8_add2_1.Leave
        Fill_Streetname(Me.cmb_8_add3, Me.txt_8_add1.Text.Trim, cmb_8_add2.Text.Trim, cmb_8_add2_1.Text.Trim)
    End Sub

    Private Sub cmb_9_add2_1_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_9_add2_1.Leave
        Fill_Streetname(Me.cmb_9_add3, Me.txt_9_add1.Text.Trim, cmb_9_add2.Text.Trim, cmb_9_add2_1.Text.Trim)
    End Sub

    Private Sub cmb_9_add3_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_9_add3.Enter
        Fill_Streetname(Me.cmb_9_add3, Me.txt_9_add1.Text.Trim, cmb_9_add2.Text.Trim, cmb_9_add2_1.Text.Trim)
    End Sub

    Private Sub cmb_9_add3_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_9_add3.Leave
        Me.Fill_Streetprefix(Me.cmb_9_add4, Me.txt_9_add1.Text.Trim, cmb_9_add2.Text.Trim, cmb_9_add2_1.Text.Trim, cmb_9_add3.Text.Trim, cmb_9_add4_1.Text.Trim)
    End Sub

    Private Sub cmb_9_add4_1_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_9_add4_1.Leave
        Me.Fill_Streetprefix(Me.cmb_9_add4, Me.txt_9_add1.Text.Trim, cmb_9_add2.Text.Trim, cmb_9_add2_1.Text.Trim, cmb_9_add3.Text.Trim, cmb_9_add4_1.Text.Trim)
    End Sub

    Private Sub cmb_9_add4_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_9_add4.Enter
        Me.Fill_Streetprefix(Me.cmb_9_add4, Me.txt_9_add1.Text.Trim, Me.cmb_9_add2.Text.Trim, cmb_9_add2_1.Text.Trim, cmb_9_add3.Text.Trim, cmb_9_add4_1.Text.Trim)
    End Sub

    Private Sub cmb_9_add4_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_9_add4.Leave
        Me.txt_9_premiseno.Text = Me.get_premiseno(Me.txt_9_add1.Text.Trim, Me.cmb_9_add2.Text.Trim, cmb_9_add2_1.Text.Trim, cmb_9_add3.Text.Trim, cmb_9_add4.Text.Trim)
    End Sub


    Private Sub cmb_x_add2_1_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_x_add2_1.Leave
        Fill_Streetname(Me.cmb_x_add3, Me.txt_x_add1.Text.Trim, cmb_x_add2.Text.Trim, cmb_x_add2_1.Text.Trim)
    End Sub

    Private Sub cmb_x_add3_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_x_add3.Enter
        Fill_Streetname(Me.cmb_x_add3, Me.txt_x_add1.Text.Trim, cmb_x_add2.Text.Trim, cmb_x_add2_1.Text.Trim)
    End Sub

    Private Sub cmb_x_add3_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_x_add3.Leave
        Me.Fill_Streetprefix(Me.cmb_x_add4, Me.txt_x_add1.Text.Trim, cmb_x_add2.Text.Trim, cmb_x_add2_1.Text.Trim, cmb_x_add3.Text.Trim, cmb_x_add4_1.Text.Trim)
    End Sub

    Private Sub cmb_x_add4_1_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_x_add4_1.Leave
        Me.Fill_Streetprefix(Me.cmb_x_add4, Me.txt_x_add1.Text.Trim, cmb_x_add2.Text.Trim, cmb_x_add2_1.Text.Trim, cmb_x_add3.Text.Trim, cmb_x_add4_1.Text.Trim)
    End Sub

    Private Sub cmb_x_add4_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_x_add4.Enter
        Me.Fill_Streetprefix(Me.cmb_x_add4, Me.txt_x_add1.Text.Trim, Me.cmb_x_add2.Text.Trim, cmb_x_add2_1.Text.Trim, cmb_x_add3.Text.Trim, cmb_x_add4_1.Text.Trim)
    End Sub

    Private Sub cmb_x_add4_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_x_add4.Leave
        Me.txt_x_premiseno.Text = Me.get_premiseno(Me.txt_x_add1.Text.Trim, Me.cmb_x_add2.Text.Trim, cmb_x_add2_1.Text.Trim, cmb_x_add3.Text.Trim, cmb_x_add4.Text.Trim)
    End Sub

    Private Sub cmb_a_add2_1_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Fill_Streetname(Me.cmb_a_add3, Me.txt_a_add1.Text.Trim, cmb_a_add2.Text.Trim, cmb_a_add2_1.Text.Trim)
    End Sub

    Private Sub cmb_a_add3_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Fill_Streetname(Me.cmb_a_add3, Me.txt_a_add1.Text.Trim, cmb_a_add2.Text.Trim, cmb_a_add2_1.Text.Trim)
    End Sub

    Private Sub cmb_a_add3_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Me.Fill_Streetprefix(Me.cmb_a_add4, Me.txt_a_add1.Text.Trim, cmb_a_add2.Text.Trim, cmb_a_add2_1.Text.Trim, cmb_a_add3.Text.Trim, cmb_a_add4_1.Text.Trim)
    End Sub

    Private Sub cmb_a_add4_1_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Me.Fill_Streetprefix(Me.cmb_a_add4, Me.txt_a_add1.Text.Trim, cmb_a_add2.Text.Trim, cmb_a_add2_1.Text.Trim, cmb_a_add3.Text.Trim, cmb_a_add4_1.Text.Trim)
    End Sub

    Private Sub cmb_a_add4_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Me.Fill_Streetprefix(Me.cmb_a_add4, Me.txt_a_add1.Text.Trim, Me.cmb_a_add2.Text.Trim, cmb_a_add2_1.Text.Trim, cmb_a_add3.Text.Trim, cmb_a_add4_1.Text.Trim)
    End Sub

    Private Sub cmb_a_add4_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Me.txt_a_premiseno.Text = Me.get_premiseno(Me.txt_a_add1.Text.Trim, Me.cmb_a_add2.Text.Trim, cmb_a_add2_1.Text.Trim, cmb_a_add3.Text.Trim, cmb_a_add4.Text.Trim)
    End Sub

    Private Sub cmb_a_add2_1_Leave_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_a_add2_1.Leave
        Fill_Streetname(Me.cmb_a_add3, Me.txt_a_add1.Text.Trim, cmb_a_add2.Text.Trim, cmb_a_add2_1.Text.Trim)
    End Sub

    Private Sub cmb_a_add3_Enter_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_a_add3.Enter
        Fill_Streetname(Me.cmb_a_add3, Me.txt_a_add1.Text.Trim, cmb_a_add2.Text.Trim, cmb_a_add2_1.Text.Trim)
    End Sub

    Private Sub cmb_a_add3_Leave_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_a_add3.Leave
        Me.Fill_Streetprefix(Me.cmb_a_add4, Me.txt_a_add1.Text.Trim, cmb_a_add2.Text.Trim, cmb_a_add2_1.Text.Trim, cmb_a_add3.Text.Trim, cmb_a_add4_1.Text.Trim)
    End Sub

    Private Sub cmb_a_add4_1_Leave_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_a_add4_1.Leave
        Me.Fill_Streetprefix(Me.cmb_a_add4, Me.txt_a_add1.Text.Trim, cmb_a_add2.Text.Trim, cmb_a_add2_1.Text.Trim, cmb_a_add3.Text.Trim, cmb_a_add4_1.Text.Trim)
    End Sub

    Private Sub cmb_a_add4_Enter_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_a_add4.Enter
        Me.Fill_Streetprefix(Me.cmb_a_add4, Me.txt_a_add1.Text.Trim, Me.cmb_a_add2.Text.Trim, cmb_a_add2_1.Text.Trim, cmb_a_add3.Text.Trim, cmb_a_add4_1.Text.Trim)
    End Sub

    Private Sub cmb_a_add4_Leave_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_a_add4.Leave
        Me.txt_a_premiseno.Text = Me.get_premiseno(Me.txt_a_add1.Text.Trim, Me.cmb_a_add2.Text.Trim, cmb_a_add2_1.Text.Trim, cmb_a_add3.Text.Trim, cmb_a_add4.Text.Trim)
    End Sub

    Private Sub cmb_q_add2_1_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_q_add2_1.Leave
        Fill_Streetname(Me.cmb_q_add3, Me.txt_q_add1.Text.Trim, cmb_q_add2.Text.Trim, cmb_q_add2_1.Text.Trim)
    End Sub

    Private Sub cmb_q_add3_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_q_add3.Enter
        Fill_Streetname(Me.cmb_q_add3, Me.txt_q_add1.Text.Trim, cmb_q_add2.Text.Trim, cmb_q_add2_1.Text.Trim)
    End Sub

    Private Sub cmb_q_add3_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_q_add3.Leave
        Me.Fill_Streetprefix(Me.cmb_q_add4, Me.txt_q_add1.Text.Trim, cmb_q_add2.Text.Trim, cmb_q_add2_1.Text.Trim, cmb_q_add3.Text.Trim, cmb_q_add4_1.Text.Trim)
    End Sub

    Private Sub cmb_q_add4_1_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_q_add4_1.Leave
        Me.Fill_Streetprefix(Me.cmb_q_add4, Me.txt_q_add1.Text.Trim, cmb_q_add2.Text.Trim, cmb_q_add2_1.Text.Trim, cmb_q_add3.Text.Trim, cmb_q_add4_1.Text.Trim)
    End Sub

    Private Sub cmb_q_add4_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_q_add4.Enter
        Me.Fill_Streetprefix(Me.cmb_q_add4, Me.txt_q_add1.Text.Trim, Me.cmb_q_add2.Text.Trim, cmb_q_add2_1.Text.Trim, cmb_q_add3.Text.Trim, cmb_q_add4_1.Text.Trim)
    End Sub

    Private Sub cmb_q_add4_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_q_add4.Leave
        Me.txt_q_premiseno.Text = Me.get_premiseno(Me.txt_q_add1.Text.Trim, Me.cmb_q_add2.Text.Trim, cmb_q_add2_1.Text.Trim, cmb_q_add3.Text.Trim, cmb_q_add4.Text.Trim)
    End Sub
    Private Sub cmb_r_add2_1_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_r_add2_1.Leave
        Fill_Streetname(Me.cmb_r_add3, Me.txt_r_add1.Text.Trim, cmb_r_add2.Text.Trim, cmb_r_add2_1.Text.Trim)
    End Sub

    Private Sub cmb_r_add3_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_r_add3.Enter
        Fill_Streetname(Me.cmb_r_add3, Me.txt_r_add1.Text.Trim, cmb_r_add2.Text.Trim, cmb_r_add2_1.Text.Trim)
    End Sub

    Private Sub cmb_r_add3_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_r_add3.Leave
        Me.Fill_Streetprefix(Me.cmb_r_add4, Me.txt_r_add1.Text.Trim, cmb_r_add2.Text.Trim, cmb_r_add2_1.Text.Trim, cmb_r_add3.Text.Trim, cmb_r_add4_1.Text.Trim)
    End Sub

    Private Sub cmb_r_add4_1_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_r_add4_1.Leave
        Me.Fill_Streetprefix(Me.cmb_r_add4, Me.txt_r_add1.Text.Trim, cmb_r_add2.Text.Trim, cmb_r_add2_1.Text.Trim, cmb_r_add3.Text.Trim, cmb_r_add4_1.Text.Trim)
    End Sub

    Private Sub cmb_r_add4_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_r_add4.Enter
        Me.Fill_Streetprefix(Me.cmb_r_add4, Me.txt_r_add1.Text.Trim, Me.cmb_r_add2.Text.Trim, cmb_r_add2_1.Text.Trim, cmb_r_add3.Text.Trim, cmb_r_add4_1.Text.Trim)
    End Sub

    Private Sub cmb_r_add4_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_r_add4.Leave
        Me.txt_r_premiseno.Text = Me.get_premiseno(Me.txt_r_add1.Text.Trim, Me.cmb_r_add2.Text.Trim, cmb_r_add2_1.Text.Trim, cmb_r_add3.Text.Trim, cmb_r_add4.Text.Trim)
    End Sub

    Private Sub cmb_l_add2_1_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_l_add2_1.Leave
        Fill_Streetname(Me.cmb_l_add3, Me.txt_l_add1.Text.Trim, cmb_l_add2.Text.Trim, cmb_l_add2_1.Text.Trim)
    End Sub

    Private Sub cmb_l_add3_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_l_add3.Enter
        Fill_Streetname(Me.cmb_l_add3, Me.txt_l_add1.Text.Trim, cmb_l_add2.Text.Trim, cmb_l_add2_1.Text.Trim)
    End Sub

    Private Sub cmb_l_add3_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_l_add3.Leave
        Me.Fill_Streetprefix(Me.cmb_l_add4, Me.txt_l_add1.Text.Trim, cmb_l_add2.Text.Trim, cmb_l_add2_1.Text.Trim, cmb_l_add3.Text.Trim, cmb_l_add4_1.Text.Trim)
    End Sub

    Private Sub cmb_l_add4_1_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_l_add4_1.Leave
        Me.Fill_Streetprefix(Me.cmb_l_add4, Me.txt_l_add1.Text.Trim, cmb_l_add2.Text.Trim, cmb_l_add2_1.Text.Trim, cmb_l_add3.Text.Trim, cmb_l_add4_1.Text.Trim)
    End Sub

    Private Sub cmb_l_add4_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_l_add4.Enter
        Me.Fill_Streetprefix(Me.cmb_l_add4, Me.txt_l_add1.Text.Trim, Me.cmb_l_add2.Text.Trim, cmb_l_add2_1.Text.Trim, cmb_l_add3.Text.Trim, cmb_l_add4_1.Text.Trim)
    End Sub

    Private Sub cmb_l_add4_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_l_add4.Leave
        Me.txt_l_premiseno.Text = Me.get_premiseno(Me.txt_l_add1.Text.Trim, Me.cmb_l_add2.Text.Trim, cmb_l_add2_1.Text.Trim, cmb_l_add3.Text.Trim, cmb_l_add4.Text.Trim)
    End Sub
    Function get_premiseno_CITY(ByVal HOUSE_NO As String, ByVal ADDR_PREFIX_1 As String, ByVal ADDR_PREFIX_2 As String, ByVal STREET_NM As String, ByVal STREET_SUFFIX_CD As String, ByVal TOWN_NM As String)
        Dim PREMISE_NO As String
        If conn.State = 0 Then
            conn.Open()
        End If
        Dim house As String
        Dim add_prefix1 As String
        Dim add_prefix2 As String
        Dim street As String
        Dim street_suf As String
        If HOUSE_NO.Trim.Length = 0 Then
            ' MsgBox("Address does not matches. Check it again.", MsgBoxStyle.Information, "Address Exception")
            PREMISE_NO = ""
            Return PREMISE_NO
            Exit Function
            house = ""
        Else
            house = HOUSE_NO
        End If

        Dim TOWN As String

        If TOWN_NM.Trim.Length = 0 Then
            ' MsgBox("Address does not matches. Check it again.", MsgBoxStyle.Information, "Address Exception")
            'PREMISE_NO = ""
            'Return PREMISE_NO
            ''Exit Function
            TOWN = ""
        Else
            TOWN = TOWN_NM
        End If


        Dim cities As String = ""

        If txt_div.Text.Trim = "Durham" Then
            cities = "DURHAM"
        ElseIf txt_div.Text.Trim = "Asheville" Then
            cities = "ASHEVILLE"
        ElseIf txt_div.Text.Trim = "Gastonia" Then
            cities = "GASTONIA"
        ElseIf txt_div.Text.Trim = "Raleigh" Then
            cities = "RALEIGH"

        ElseIf txt_div.Text.Trim = "CENTRAL" Then
            cities = "CENTRAL "
        ElseIf txt_div.Text.Trim = "EASTERN" Then
            cities = "EASTERN"
        ElseIf txt_div.Text.Trim = "COASTAL" Then
            cities = "COASTAL"
        ElseIf txt_div.Text.Trim = "LOW COUNTRY" Then
            cities = "LOW COUNTRY"
        ElseIf txt_div.Text.Trim = "SOUTHERN" Then
            cities = "SOUTHERN"
        ElseIf txt_div.Text.Trim = "WESTERN" Then
            cities = "WESTERN"
        End If

        If ADDR_PREFIX_1.Trim.Length = 0 Then
            add_prefix1 = ""
        Else
            add_prefix1 = ADDR_PREFIX_1
        End If
        If ADDR_PREFIX_2.Trim.Length = 0 Then
            add_prefix2 = ""
        Else
            add_prefix2 = ADDR_PREFIX_2
        End If
        If STREET_NM.Trim.Length = 0 Then
            street = ""
        Else
            street = STREET_NM
        End If
        If STREET_SUFFIX_CD.Trim.Length = 0 Then
            street_suf = ""
        Else
            street_suf = STREET_SUFFIX_CD
        End If
        Dim dr As SqlDataReader = Nothing
        cmd = New SqlCommand("Get_premise_no_city", conn)
        cmd.CommandType = CommandType.StoredProcedure
        cmd.Parameters.AddWithValue("@HOUSE_NO", house)
        cmd.Parameters.AddWithValue("@ADDR_PREFIX_1", add_prefix1)
        cmd.Parameters.AddWithValue("@ADDR_PREFIX_2", add_prefix2)
        cmd.Parameters.AddWithValue("@STREET_NM", street)
        cmd.Parameters.AddWithValue("@TOWN_NM", TOWN)
        cmd.Parameters.AddWithValue("@STREET_SUFFIX_CD", street_suf)
        cmd.Parameters.AddWithValue("@divison", cities)

        'cmd = New SqlCommand("select ISNULL(max(PREMISE_NO),0) from Address  where " & house & " and " & add_prefix1 & " and " & add_prefix2 & "  and " & street & " and " & street_suf & " and " & cities & " and " & TOWN, conn)
        dr = cmd.ExecuteReader(CommandBehavior.CloseConnection)
        If (dr.Read) Then
            If dr(0).ToString = 0 Then
                MsgBox("Address does not matches. Check it again.", MsgBoxStyle.Information, "Address Exception")
                PREMISE_NO = ""
            Else
                PREMISE_NO = dr(0).ToString
            End If
        Else
            PREMISE_NO = ""
        End If
        dr.Close()
        Return PREMISE_NO
    End Function

    Private Sub cmb_l_city_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_y_city.Leave, cmb_l_city.Leave, cmb_q_city.Leave, cmb_r_city.Leave, cmb_a_city.Leave, cmb_x_city.Leave, cmb_9_city.Leave, cmb_8_city.Leave, cmb_7_city.Leave, cmb_6_city.Leave, cmb_5_city.Leave, cmb_4_city.Leave, cmb_3_city.Leave, cmb_w_city.Leave
        'FORM-100BLK
        If cmb_formtype.Text.Trim = "FORM-100BLK" Then
            Me.txt_100b_premiseno.Text = Me.get_premiseno_CITY(Me.txt_100b_add1.Text.Trim, Me.cmb_100b_add2.Text.Trim, cmb_100b_add2_1.Text.Trim, cmb_100b_add3.Text.Trim, cmb_100b_add4.Text.Trim, cmb_100b_city.Text.Trim)

            'FORM-100BLK-MISC
        ElseIf cmb_formtype.Text.Trim = "FORM-100BLK-MISC" Then
            Me.txt_100b_m_premiseno.Text = Me.get_premiseno_CITY(Me.txt_100b_m_add1.Text.Trim, Me.cmb_100b_m_add2.Text.Trim, cmb_100b_m_add2_1.Text.Trim, cmb_100b_m_add3.Text.Trim, cmb_100b_m_add4.Text.Trim, cmb_100b_m_city.Text.Trim)

            'FORM-200BLK
        ElseIf cmb_formtype.Text.Trim = "FORM-200BLK" Then
            Me.txt_200b_premiseno.Text = Me.get_premiseno_CITY(Me.txthouseNo1.Text.Trim, Me.cmbPrefix11.Text.Trim, cmbPrefix22.Text.Trim, cmbStreetname1.Text.Trim, cmbsuffix22.Text.Trim, cmb_200b_city.Text.Trim)


        ElseIf cmb_formtype.Text.Trim = "Yellow" Then
            Me.txt_y_premiseno.Text = Me.get_premiseno_CITY(Me.txt_y_add1.Text.Trim, Me.cmb_y_add2.Text.Trim, cmb_y_add2_1.Text.Trim, cmb_y_add3.Text.Trim, cmb_y_add4.Text.Trim, cmb_y_city.Text.Trim)
        ElseIf cmb_formtype.Text.Trim = "MISC" Then
            Me.txt_l_premiseno.Text = Me.get_premiseno_CITY(Me.txt_l_add1.Text.Trim, Me.cmb_l_add2.Text.Trim, cmb_l_add2_1.Text.Trim, cmb_l_add3.Text.Trim, cmb_l_add4.Text.Trim, cmb_l_city.Text.Trim)


        ElseIf cmb_formtype.Text.Trim = "ORIGINAL" Then
            Me.txt_q_premiseno.Text = Me.get_premiseno_CITY(Me.txt_q_add1.Text.Trim, Me.cmb_q_add2.Text.Trim, cmb_q_add2_1.Text.Trim, cmb_q_add3.Text.Trim, cmb_q_add4.Text.Trim, cmb_q_city.Text.Trim)
        ElseIf cmb_formtype.Text.Trim = "ORIGINAL-R" Then
            Me.txt_r_premiseno.Text = Me.get_premiseno_CITY(Me.txt_r_add1.Text.Trim, Me.cmb_r_add2.Text.Trim, cmb_r_add2_1.Text.Trim, cmb_r_add3.Text.Trim, cmb_r_add4.Text.Trim, cmb_r_city.Text.Trim)
        ElseIf cmb_formtype.Text.Trim = "ABANDON-II" Then
            Me.txt_a_premiseno.Text = Me.get_premiseno_CITY(Me.txt_a_add1.Text.Trim, Me.cmb_a_add2.Text.Trim, cmb_a_add2_1.Text.Trim, cmb_a_add3.Text.Trim, cmb_a_add4.Text.Trim, cmb_a_city.Text.Trim)

        ElseIf cmb_formtype.Text.Trim = "Form-X" Then
            Me.txt_x_premiseno.Text = Me.get_premiseno_CITY(Me.txt_x_add1.Text.Trim, Me.cmb_x_add2.Text.Trim, cmb_x_add2_1.Text.Trim, cmb_x_add3.Text.Trim, cmb_x_add4.Text.Trim, cmb_x_city.Text.Trim)

        ElseIf cmb_formtype.Text.Trim = "FORM-IX" Then
            Me.txt_9_premiseno.Text = Me.get_premiseno_CITY(Me.txt_9_add1.Text.Trim, Me.cmb_9_add2.Text.Trim, cmb_9_add2_1.Text.Trim, cmb_9_add3.Text.Trim, cmb_9_add4.Text.Trim, cmb_9_city.Text.Trim)

        ElseIf cmb_formtype.Text.Trim = "ABANDON-I" Then
            Me.txt_8_premiseno.Text = Me.get_premiseno_CITY(Me.txt_8_add1.Text.Trim, Me.cmb_8_add2.Text.Trim, cmb_8_add2_1.Text.Trim, cmb_8_add3.Text.Trim, cmb_8_add4.Text.Trim, cmb_8_city.Text.Trim)

        ElseIf cmb_formtype.Text.Trim = "Form-954" Then
            Me.txt_7_premiseno.Text = Me.get_premiseno_CITY(Me.txt_7_add1.Text.Trim, Me.cmb_7_add2.Text.Trim, cmb_7_add2_1.Text.Trim, cmb_7_add3.Text.Trim, cmb_7_add4.Text.Trim, cmb_7_city.Text.Trim)
        ElseIf cmb_formtype.Text.Trim = "Form-80I" Then
            Me.txt_6_premiseno.Text = Me.get_premiseno_CITY(Me.txt_6_add1.Text.Trim, Me.cmb_6_add2.Text.Trim, cmb_6_add2_1.Text.Trim, cmb_6_add3.Text.Trim, cmb_6_add4.Text.Trim, cmb_6_city.Text.Trim)

        ElseIf cmb_formtype.Text.Trim = "White" Then
            Me.txt_w_premiseno.Text = Me.get_premiseno_CITY(Me.txt_w_add1.Text.Trim, Me.cmb_w_add2.Text.Trim, cmb_w_add2_1.Text.Trim, cmb_w_add3.Text.Trim, cmb_w_add4.Text.Trim, cmb_w_city.Text.Trim)

        ElseIf cmb_formtype.Text.Trim = "Orange" Then
            Me.txt_3_premiseno.Text = Me.get_premiseno_CITY(Me.txt_3_add1.Text.Trim, Me.cmb_3_add2.Text.Trim, cmb_3_add2_1.Text.Trim, cmb_3_add3.Text.Trim, cmb_3_add4.Text.Trim, cmb_3_city.Text.Trim)

        ElseIf cmb_formtype.Text.Trim = "Form235-B-702" Then
            Me.txt_4_premiseno.Text = Me.get_premiseno_CITY(Me.txt_4_add1.Text.Trim, Me.cmb_4_add2.Text.Trim, cmb_4_add2_1.Text.Trim, cmb_4_add3.Text.Trim, cmb_4_add4.Text.Trim, cmb_4_city.Text.Trim)

        ElseIf cmb_formtype.Text.Trim = "OD-9-6-38" Then
            Me.txt_5_premiseno.Text = Me.get_premiseno_CITY(Me.txt_5_add1.Text.Trim, Me.cmb_5_add2.Text.Trim, cmb_5_add2_1.Text.Trim, cmb_5_add3.Text.Trim, cmb_5_add4.Text.Trim, cmb_5_city.Text.Trim)

        End If

    End Sub

    Private Sub Label32_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label32.Click

    End Sub

    Private Sub btn_premiselookup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_premiselookup.Click
        Dim house_no As String = ""
        Dim ADDR_PREFIX_1 As String = ""
        Dim ADDR_PREFIX_2 As String = ""
        Dim STREET_NM As String = ""
        Dim ADDR_SUFFIX_CD As String = ""
        Dim STREET_SUFFIX_CD As String = ""
        Dim TOWN_NM As String = ""

        'FORM-100BLK
        If cmb_formtype.Text.Trim = "FORM-100BLK" Then
            house_no = txt_100b_add1.Text
            ADDR_PREFIX_1 = cmb_100b_add2.Text
            ADDR_PREFIX_2 = cmb_100b_add2_1.Text
            STREET_NM = cmb_100b_add3.Text
            ADDR_SUFFIX_CD = cmb_100b_add4_1.Text
            STREET_SUFFIX_CD = cmb_100b_add4.Text
            TOWN_NM = cmb_100b_city.Text
            ' Me.txt_100b_premiseno.Text = ""

            'FORM-100BLK-MISC
        ElseIf cmb_formtype.Text.Trim = "FORM-100BLK-MISC" Then
            house_no = txt_100b_m_add1.Text
            ADDR_PREFIX_1 = cmb_100b_m_add2.Text
            ADDR_PREFIX_2 = cmb_100b_m_add2_1.Text
            STREET_NM = cmb_100b_m_add3.Text
            ADDR_SUFFIX_CD = cmb_100b_m_add4_1.Text
            STREET_SUFFIX_CD = cmb_100b_m_add4.Text
            TOWN_NM = cmb_100b_m_city.Text
            ' Me.txt_100b_m_premiseno.Text = ""

            'FORM-200BLK N
        ElseIf cmb_formtype.Text.Trim = "FORM-200BLK" Then
            house_no = txthouseNo1.Text
            ADDR_PREFIX_1 = cmbPrefix11.Text
            ADDR_PREFIX_2 = cmbPrefix22.Text
            STREET_NM = cmbStreetname1.Text
            ADDR_SUFFIX_CD = cmbsuffix12.Text
            STREET_SUFFIX_CD = cmbsuffix22.Text
            TOWN_NM = cmb_200b_city.Text
            '' Me.txt_200b_premiseno.Text = ""
        ElseIf cmb_formtype.Text.Trim = "Yellow" Then
            house_no = txt_y_add1.Text
            ADDR_PREFIX_1 = cmb_y_add2.Text
            ADDR_PREFIX_2 = cmb_y_add2_1.Text
            STREET_NM = cmb_y_add3.Text
            ADDR_SUFFIX_CD = cmb_y_add4_1.Text
            STREET_SUFFIX_CD = cmb_y_add4.Text
            TOWN_NM = cmb_y_city.Text
            ' Me.txt_y_premiseno.Text = ""
        ElseIf cmb_formtype.Text.Trim = "ORIGINAL" Then
            house_no = txt_q_add1.Text
            ADDR_PREFIX_1 = cmb_q_add2.Text
            ADDR_PREFIX_2 = cmb_q_add2_1.Text
            STREET_NM = cmb_q_add3.Text
            ADDR_SUFFIX_CD = cmb_q_add4_1.Text
            STREET_SUFFIX_CD = cmb_q_add4.Text
            TOWN_NM = cmb_q_city.Text
            ' Me.txt_q_premiseno.Text = ""
        ElseIf cmb_formtype.Text.Trim = "MISC" Then
            house_no = txt_l_add1.Text
            ADDR_PREFIX_1 = cmb_l_add2.Text
            ADDR_PREFIX_2 = cmb_l_add2_1.Text
            STREET_NM = cmb_l_add3.Text
            ADDR_SUFFIX_CD = cmb_l_add4_1.Text
            STREET_SUFFIX_CD = cmb_l_add4.Text
            TOWN_NM = cmb_l_city.Text
            'Me.txt_l_premiseno.Text = ""
        ElseIf cmb_formtype.Text.Trim = "ORIGINAL-R" Then
            house_no = txt_r_add1.Text
            ADDR_PREFIX_1 = cmb_r_add2.Text
            ADDR_PREFIX_2 = cmb_r_add2_1.Text
            STREET_NM = cmb_r_add3.Text
            ADDR_SUFFIX_CD = cmb_r_add4_1.Text
            STREET_SUFFIX_CD = cmb_r_add4.Text
            TOWN_NM = cmb_r_city.Text
            'Me.txt_r_premiseno.Text = ""
        ElseIf cmb_formtype.Text.Trim = "ABANDON-II" Then
            house_no = txt_a_add1.Text
            ADDR_PREFIX_1 = cmb_a_add2.Text
            ADDR_PREFIX_2 = cmb_a_add2_1.Text
            STREET_NM = cmb_a_add3.Text
            ADDR_SUFFIX_CD = cmb_a_add4_1.Text
            STREET_SUFFIX_CD = cmb_a_add4.Text
            TOWN_NM = cmb_a_city.Text
            'Me.txt_a_premiseno.Text = ""
        ElseIf cmb_formtype.Text.Trim = "Form-X" Then
            house_no = txt_x_add1.Text
            ADDR_PREFIX_1 = cmb_x_add2.Text
            ADDR_PREFIX_2 = cmb_x_add2_1.Text
            STREET_NM = cmb_x_add3.Text
            ADDR_SUFFIX_CD = cmb_x_add4_1.Text
            STREET_SUFFIX_CD = cmb_x_add4.Text
            TOWN_NM = cmb_x_city.Text
            'Me.txt_x_premiseno.Text = ""
        ElseIf cmb_formtype.Text.Trim = "FORM-IX" Then
            house_no = txt_9_add1.Text
            ADDR_PREFIX_1 = cmb_9_add2.Text
            ADDR_PREFIX_2 = cmb_9_add2_1.Text
            STREET_NM = cmb_9_add3.Text
            ADDR_SUFFIX_CD = cmb_9_add4_1.Text
            STREET_SUFFIX_CD = cmb_9_add4.Text
            TOWN_NM = cmb_9_city.Text
            'Me.txt_9_premiseno.Text = ""
        ElseIf cmb_formtype.Text.Trim = "Form-954" Then
            house_no = txt_7_add1.Text
            ADDR_PREFIX_1 = cmb_7_add2.Text
            ADDR_PREFIX_2 = cmb_7_add2_1.Text
            STREET_NM = cmb_7_add3.Text
            ADDR_SUFFIX_CD = cmb_7_add4_1.Text
            STREET_SUFFIX_CD = cmb_7_add4.Text
            TOWN_NM = cmb_7_city.Text
            'Me.txt_7_premiseno.Text = ""
        ElseIf cmb_formtype.Text.Trim = "ABANDON-I" Then
            house_no = txt_8_add1.Text
            ADDR_PREFIX_1 = cmb_8_add2.Text
            ADDR_PREFIX_2 = cmb_8_add2_1.Text
            STREET_NM = cmb_8_add3.Text
            ADDR_SUFFIX_CD = cmb_8_add4_1.Text
            STREET_SUFFIX_CD = cmb_8_add4.Text
            TOWN_NM = cmb_8_city.Text
            'Me.txt_8_premiseno.Text = ""
        ElseIf cmb_formtype.Text.Trim = "Form-80I" Then
            house_no = txt_6_add1.Text
            ADDR_PREFIX_1 = cmb_6_add2.Text
            ADDR_PREFIX_2 = cmb_6_add2_1.Text
            STREET_NM = cmb_6_add3.Text
            ADDR_SUFFIX_CD = cmb_6_add4_1.Text
            STREET_SUFFIX_CD = cmb_6_add4.Text
            TOWN_NM = cmb_6_city.Text
            'Me.txt_6_premiseno.Text = ""
        ElseIf cmb_formtype.Text.Trim = "OD-9-6-38" Then
            house_no = txt_5_add1.Text
            ADDR_PREFIX_1 = cmb_5_add2.Text
            ADDR_PREFIX_2 = cmb_5_add2_1.Text
            STREET_NM = cmb_5_add3.Text
            ADDR_SUFFIX_CD = cmb_5_add4_1.Text
            STREET_SUFFIX_CD = cmb_5_add4.Text
            TOWN_NM = cmb_5_city.Text
            'Me.txt_5_premiseno.Text = ""
        ElseIf cmb_formtype.Text.Trim = "Form235-B-702" Then
            house_no = txt_4_add1.Text
            ADDR_PREFIX_1 = cmb_4_add2.Text
            ADDR_PREFIX_2 = cmb_4_add2_1.Text
            STREET_NM = cmb_4_add3.Text
            ADDR_SUFFIX_CD = cmb_4_add4_1.Text
            STREET_SUFFIX_CD = cmb_4_add4.Text
            TOWN_NM = cmb_4_city.Text
            'txt_4_premiseno.Text = ""
        ElseIf cmb_formtype.Text.Trim = "White" Then
            house_no = txt_w_add1.Text
            ADDR_PREFIX_1 = cmb_w_add2.Text
            ADDR_PREFIX_2 = cmb_w_add2_1.Text
            STREET_NM = cmb_w_add3.Text
            ADDR_SUFFIX_CD = cmb_w_add4_1.Text
            STREET_SUFFIX_CD = cmb_w_add4.Text
            TOWN_NM = cmb_w_city.Text
            'Me.txt_w_premiseno.Text = ""
        ElseIf Me.cmb_formtype.Text.Trim = "Orange" Then
            house_no = txt_3_add1.Text
            ADDR_PREFIX_1 = cmb_3_add2.Text
            ADDR_PREFIX_2 = cmb_3_add2_1.Text
            STREET_NM = cmb_3_add3.Text
            ADDR_SUFFIX_CD = cmb_3_add4_1.Text
            STREET_SUFFIX_CD = cmb_3_add4.Text
            TOWN_NM = cmb_3_city.Text
            'txt_3_premiseno.Text = ""
        End If



        Dim S_Get_premise As New S_Get_premise(house_no, ADDR_PREFIX_1, ADDR_PREFIX_2, STREET_NM, ADDR_SUFFIX_CD, STREET_SUFFIX_CD, TOWN_NM)
        S_Get_premise.ShowDialog()
        S_Get_premise.BringToFront()
        S_Get_premise.Focus()
    End Sub
    

    Private Sub radbtnmissmatch_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles radbtnmissmatch.CheckedChanged
        If radbtnmissmatch.Checked = True Then

            Label62.Visible = True
            txtreassignshow.Visible = True
        Else
            Label62.Visible = False
            txtreassignshow.Visible = False
        End If
    End Sub

    Private Sub testdate(ByVal txtbox As TextBox)
        If txtbox.Text.Trim <> "" Then
            Try
                Dim a As Date
                a = CDate(txtbox.Text.Trim)
                txtbox.Text = Format(a, "MM/dd/yyyy")
            Catch ex As Exception
                MsgBox("Invalid Date Format.", MsgBoxStyle.Critical, "Date Exception")
                txtbox.Focus()
            End Try
        End If
    End Sub

    Private Sub txt_q_dated_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txt_q_dated.Leave, txt_y_dated.Leave, txt_r_dated.Leave, txt_a_dateabandon.Leave, txt_x_dated.Leave, txt_9_dated.Leave, txt_7_dated.Leave, txt_8_dateabandon.Leave, txt_8_dated.Leave, txt_6_dated.Leave, txt_5_dated.Leave, txt_4_dated.Leave, txt_3_dated.Leave, txt_w_dated.Leave
        testdate(sender)
    End Sub

    Private Sub txt_100b_dated_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs)
        testdate(sender)
    End Sub

    Private Sub txt_100b_dateabandon_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs)
        testdate(sender)
    End Sub

    Private Sub txtDate1_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs)
        testdate(sender)
    End Sub

    Private Sub txt_Retired_date_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs)
        testdate(sender)
    End Sub


    Private Sub txt_100b_m_dated_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs)
        testdate(sender)
    End Sub

    Private Sub txt_100b_m_dateabandon_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs)
        testdate(sender)
    End Sub

    '---100 block Address
    Private Sub cmb_100b_add2_1_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Fill_Streetname(Me.cmb_100b_add3, Me.txt_100b_add1.Text.Trim, cmb_100b_add2.Text.Trim, cmb_100b_add2_1.Text.Trim)
    End Sub

    Private Sub cmb_100b_add3_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Fill_Streetname(Me.cmb_100b_add3, Me.txt_100b_add1.Text.Trim, cmb_100b_add2.Text.Trim, cmb_100b_add2_1.Text.Trim)
    End Sub

    Private Sub cmb_100b_add3_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Me.Fill_Streetprefix(Me.cmb_100b_add4, Me.txt_100b_add1.Text.Trim, cmb_100b_add2.Text.Trim, cmb_100b_add2_1.Text.Trim, cmb_100b_add3.Text.Trim, cmb_100b_add4_1.Text.Trim)
    End Sub

    Private Sub cmb_100b_add4_1_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Me.Fill_Streetprefix(Me.cmb_100b_add4, Me.txt_100b_add1.Text.Trim, cmb_100b_add2.Text.Trim, cmb_100b_add2_1.Text.Trim, cmb_100b_add3.Text.Trim, cmb_100b_add4_1.Text.Trim)
    End Sub

    Private Sub cmb_100b_add4_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Me.Fill_Streetprefix(Me.cmb_100b_add4, Me.txt_100b_add1.Text.Trim, Me.cmb_100b_add2.Text.Trim, cmb_100b_add2_1.Text.Trim, cmb_100b_add3.Text.Trim, cmb_100b_add4_1.Text.Trim)

    End Sub

    Private Sub cmb_100b_add4_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Me.txt_100b_premiseno.Text = Me.get_premiseno(Me.txt_100b_add1.Text.Trim, Me.cmb_100b_add2.Text.Trim, cmb_100b_add2_1.Text.Trim, cmb_100b_add3.Text.Trim, cmb_100b_add4.Text.Trim)
    End Sub

    ''FORM-100BLK-MISC Address
    Private Sub cmb_100b_m_add2_1_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Fill_Streetname(Me.cmb_100b_m_add3, Me.txt_100b_m_add1.Text.Trim, cmb_100b_m_add2.Text.Trim, cmb_100b_m_add2_1.Text.Trim)
    End Sub

    Private Sub cmb_100b_m_add3_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Fill_Streetname(Me.cmb_100b_m_add3, Me.txt_100b_m_add1.Text.Trim, cmb_100b_m_add2.Text.Trim, cmb_100b_m_add2_1.Text.Trim)
    End Sub

    Private Sub cmb_100b_m_add3_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Me.Fill_Streetprefix(Me.cmb_100b_m_add4, Me.txt_100b_m_add1.Text.Trim, cmb_100b_m_add2.Text.Trim, cmb_100b_m_add2_1.Text.Trim, cmb_100b_m_add3.Text.Trim, cmb_100b_m_add4_1.Text.Trim)
    End Sub

    Private Sub cmb_100b_m_add4_1_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Me.Fill_Streetprefix(Me.cmb_100b_m_add4, Me.txt_100b_m_add1.Text.Trim, cmb_100b_add2.Text.Trim, cmb_100b_add2_1.Text.Trim, cmb_100b_m_add3.Text.Trim, cmb_100b_m_add4_1.Text.Trim)
    End Sub

    Private Sub cmb_100b_m_add4_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Me.Fill_Streetprefix(Me.cmb_100b_m_add4, Me.txt_100b_m_add1.Text.Trim, Me.cmb_100b_m_add2.Text.Trim, cmb_100b_m_add2_1.Text.Trim, cmb_100b_m_add3.Text.Trim, cmb_100b_m_add4_1.Text.Trim)
    End Sub

    Private Sub cmb_100b_m_add4_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Me.txt_100b_m_premiseno.Text = Me.get_premiseno(Me.txt_100b_m_add1.Text.Trim, Me.cmb_100b_m_add2.Text.Trim, cmb_100b_m_add2_1.Text.Trim, cmb_100b_m_add3.Text.Trim, cmb_100b_m_add4.Text.Trim)
    End Sub

    '--200 block Address
    Private Sub cmbPrefix22_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Fill_Streetname(Me.cmbStreetname1, Me.txthouseNo1.Text.Trim, cmbPrefix11.Text.Trim, cmbPrefix22.Text.Trim)
    End Sub

    Private Sub cmbStreetname1_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Fill_Streetname(Me.cmbStreetname1, Me.txthouseNo1.Text.Trim, cmbPrefix11.Text.Trim, cmbPrefix22.Text.Trim)
    End Sub

    Private Sub cmbStreetname1_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Me.Fill_Streetprefix(Me.cmbsuffix22, Me.txthouseNo1.Text.Trim, cmbPrefix11.Text.Trim, cmbPrefix22.Text.Trim, cmbStreetname1.Text.Trim, cmbsuffix12.Text.Trim)
    End Sub

    Private Sub cmbsuffix12_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Me.Fill_Streetprefix(Me.cmbsuffix22, Me.txthouseNo1.Text.Trim, cmbPrefix11.Text.Trim, cmbPrefix22.Text.Trim, cmbStreetname1.Text.Trim, cmbsuffix12.Text.Trim)
    End Sub

    Private Sub cmbsuffix22_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Me.Fill_Streetprefix(Me.cmbsuffix22, Me.txthouseNo1.Text.Trim, Me.cmbPrefix11.Text.Trim, cmbPrefix22.Text.Trim, cmbStreetname1.Text.Trim, cmbsuffix12.Text.Trim)
    End Sub

    Private Sub cmbsuffix22_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Me.txt_200b_premiseno.Text = Me.get_premiseno(Me.txthouseNo1.Text.Trim, Me.cmbPrefix11.Text.Trim, cmbPrefix22.Text.Trim, cmbStreetname1.Text.Trim, cmbsuffix22.Text.Trim)
    End Sub


    Private Sub txt_100b_dated_DragLeave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txt_100b_dated.DragLeave

    End Sub

    Private Sub txt_100b_dateabandon_Leave_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txt_100b_dateabandon.Leave

    End Sub

    Private Sub txt_100b_m_dated_Leave_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txt_100b_m_dated.Leave
        testdate(sender)
    End Sub

    Private Sub txt_100b_m_dateabandon_Leave_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txt_100b_m_dateabandon.Leave
        testdate(sender)
    End Sub

    Private Sub txtDate1_Leave_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtDate1.Leave
        testdate(sender)
    End Sub

    Private Sub txt_Retired_date_Leave_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txt_Retired_date.Leave
        testdate(sender)
    End Sub

    Private Sub lnk100blkGetInYear_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles lnk100blkGetInYear.LinkClicked
        GetDateFromInstalledDate(txt_100b_dated, txt_100b_installedyear)
    End Sub

    Private Sub lnk100blkMiscGetInYear_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles lnk100blkMiscGetInYear.LinkClicked
        GetDateFromInstalledDate(txt_100b_m_dated, txt_100b_m_installedyear)
    End Sub
    Private Sub GetDateFromInstalledDate(ByVal textBoxInDate As TextBox, ByVal textBoxInYear As TextBox)
        If textBoxInDate.Text.Trim <> "" Then
            Try
                textBoxInYear.Text = CDate(textBoxInDate.Text.Trim).Year
            Catch ex As Exception
                MsgBox("Invalid Date Format.", MsgBoxStyle.Critical, "Date Exception")
                textBoxInYear.Focus()
            End Try
        Else
            MsgBox("Can not get year from Installed Date", MsgBoxStyle.Critical, "Date Exception")
        End If
    End Sub
End Class