entonces en un combo... seleccionamos la clave_planta para ke me muestre sus registros correspondientes y lo hago de la siguiente manera:
Private Sub CmbclvE_catpla_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles CmbclvE_catpla.Click
Dim obj As New Sergio.Villaneda.Data.MySQL
conexion(obj)
Dim comm As New MySql.Data.MySqlClient.MySqlCommand("select nom_planta,clave_planta,nom_destino,nom_cliente from cat_planta,cat_destino,cat_cliente where cat_planta.clave_destino=cat_destino.clave_destino and cat_planta.clave_cliente=cat_cliente.clave_cliente ")
obj.SELECT_COMMAND = comm
CmbclvE_catpla.DisplayMember = "clave_planta"
CmbclvE_catpla.DataSource = obj.SelectFields()
End Sub
pero mi problema esta en ke no puedo modificar..pero chequen dato a la hora ke yo hago la consulta en realidad estoy mostrando el nom_cliente y no la clave_cliente asi mismo para destino yo digo ke ahi esta el problema---asi es como hago la actualizacion: o modificacion...
Private Sub But7modificar_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles But7modificar.Click
Dim obj As New Sergio.Villaneda.Data.MySQL
conexion(obj)
Dim comm As New MySql.Data.MySqlClient.MySqlCommand("UPDATE cat_planta set nom_planta='" + Me.Txtnom_catpla.Text + "',clave_cliente=(select clave_cliente from cat_cliente where nom_cliente='" + Cmbclient_catpla.SelectedValue.ToString + "'), clave_destino=(select clave_destino from cat_destino where nom_destino='" + Cmbdest_catpla.SelectedValue.ToString + "') where clave_planta='" + CmbclvM_catpla.Text + "'")
obj.UPDATE_COMMAND = comm
If obj.UpdateFields() Then
'Me.CmbclvM_catpla.Refresh()
MsgBox("la planta se modifico correctamente.", vbInformation, "")
Txtnom_catpla.Text = ""
Txtcli_regpla.Text = ""
Txtdest_catpla.Text = ""
CmbclvM_catpla.Text = ""
Cmbclient_catpla.Text = ""
Cmbdest_catpla.Text = ""
else
MsgBox("error al modificar", vbInformation, "")
End If
End Sub
Espero que me puedan ayudar..o dar otra solucion para hacer la modificacion....gracias
