Hi to everyone,
I have a little question for this forum, hoping someone may help me.
I have a sub (stored in a module.vb) called from two forms.
Subroutine simply fill a combobox with a database records. I need to fill another combobox (with the same name) in another form.
Code is following:
If you see, this sub fill combobox in form frmAnagrafica; I would fill combobox in form frmSelection.
Is there a simple way to identify form that call subroutine?
Thanks
I have a little question for this forum, hoping someone may help me.
I have a sub (stored in a module.vb) called from two forms.
Subroutine simply fill a combobox with a database records. I need to fill another combobox (with the same name) in another form.
Code is following:
VB.NET:
Public Sub listNames()
Dim Cmd As New OleDb.OleDbCommand(strSQL, objconn)
Dim DataReader As OleDb.OleDbDataReader
Try
DataReader = Cmd.ExecuteReader
While DataReader.Read()
frmAnagrafica.cboElencoNomi.Items.Add(Trim(DataReader("Cognome")) & " " & Trim(DataReader("Nome")) & " - [" & Trim(DataReader("CodiceFiscale")) & "]")
End While
Catch
MsgBox("Si è verificato un errore." & vbNewLine & Err.Description, MsgBoxStyle.Critical, "Errore: " & Err.Number)
Finally
Cmd = Nothing
DataReader.Close()
DataReader = Nothing
End Try
End Sub
Is there a simple way to identify form that call subroutine?
Thanks
Last edited by a moderator: