ho controllato negli eventi delle textbox ma niente!!...
questo è il codice:
codice:
Private str_sql As String
Private Sub cmb_anni_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_anni.SelectedIndexChanged
Call caricaListView()
End Sub
Private Sub tbc_spese_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tbc_spese.SelectedIndexChanged
If tbc_spese.SelectedIndex = 1 Then
Me.Close()
FormSpese.CustomerForm = Nothing
End If
End Sub
Private Sub btt_nuova_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btt_nuova.Click
If Trim(txtId_stabile.Text) = "" Then
MessageBox.Show("Selezionare stabile.", "", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
txtId_stabile.Focus()
Exit Sub
End If
If FormNuovaSpesa.CustomerForm Is Nothing Then
Dim frmNuovaSpesaChild As New frmNuovaSpesa()
frmNuovaSpesaChild.MdiParent = Me.MdiParent
frmNuovaSpesaChild.Show()
FormNuovaSpesa.CustomerForm = frmNuovaSpesaChild
FormNuovaSpesa.CustomerForm.int_idStabile = CInt(txtId_stabile.Text)
Call recuperoIdSocieta()
Else
FormNuovaSpesa.CustomerForm.Show()
FormNuovaSpesa.CustomerForm.int_idStabile = CInt(txtId_stabile.Text)
Call recuperoIdSocieta()
End If
End Sub
Private Sub frmSpese_Closed(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Closed
If Not FormNuovaSpesa.CustomerForm Is Nothing Then
FormNuovaSpesa.CustomerForm.Close()
FormNuovaSpesa.CustomerForm = Nothing
End If
Dim objFunzioni As New ClasseFunzioni.Funzioni()
objFunzioni.SetList("", FormMenù.CustomerForm.ListView1)
objFunzioni.CloseConnection()
objFunzioni = Nothing
End Sub
Private Sub caricaListView()
If cmb_anni.Text <> "" Then
Dim objFunzioni As New ClasseFunzioni.Funzioni()
objFunzioni.SetList("Spesa", lst_spese)
Exit Sub
End If
End Sub
Private Sub recuperoIdSocieta()
str_sql = "SELECT [Societa].[id_societa] " & _
"FROM (Societa INNER JOIN Complesso ON [Societa].[id_societa]=[Complesso].[id_societa]) " & _
"INNER JOIN Stabile ON [Complesso].[id_complesso]=[Stabile].[id_complesso] " & _
"WHERE ((([Stabile].[id_stabile])= " & txtId_stabile.Text & "));"
Dr = obj_funzioniDb.fnzExecuteRead(str_sql)
If Dr.Read Then
FormNuovaSpesa.CustomerForm.int_idSocieta = Dr("id_societa")
End If
Dr.Close()
End Sub
Questa occasione sembrerebbe verificarsi dopo il click sulla listview dove viene riportare il testo dalla lista alla text