A
Adrian
Hello!
I have this code, and I need that combobox "ELEGIR" not only shows to me the"ID" of the table dbo_Departamento, but also the field "Description" of the same table.
Please, Read the code carefully, since it works very well, but I dont know what I must add to him so that it shows in combobox that column!
--------------------------------------------------------------------------------
Private Sub Comando6_Click()
If Not IsNull([ELEGIR]) Then
DoCmd.OpenForm "CAUSA 2", , , "[idDepartamento]=[forms]![inicial]![elegir]"
End If
DoCmd.Close acForm, "inicial"
End Sub
Private Sub Elegir_AfterUpdate()
DoCmd.SetWarnings False
DoCmd.RunSQL "Insert into uDepartamento(uDepartamento)values(elegir)"
End Sub
Private Sub Elegir_GotFocus()
If DCount("uDepartamento", "uDepartamento") = 0 Then
ELEGIR.RowSource = "select id from dbo_Departamento"
Else
ELEGIR.RowSource = "select uDepartamento from a"
End If
End Sub
Private Sub Form_Current()
última = DLast("uDepartamento", "a")
End Sub
I have this code, and I need that combobox "ELEGIR" not only shows to me the"ID" of the table dbo_Departamento, but also the field "Description" of the same table.
Please, Read the code carefully, since it works very well, but I dont know what I must add to him so that it shows in combobox that column!
--------------------------------------------------------------------------------
Private Sub Comando6_Click()
If Not IsNull([ELEGIR]) Then
DoCmd.OpenForm "CAUSA 2", , , "[idDepartamento]=[forms]![inicial]![elegir]"
End If
DoCmd.Close acForm, "inicial"
End Sub
Private Sub Elegir_AfterUpdate()
DoCmd.SetWarnings False
DoCmd.RunSQL "Insert into uDepartamento(uDepartamento)values(elegir)"
End Sub
Private Sub Elegir_GotFocus()
If DCount("uDepartamento", "uDepartamento") = 0 Then
ELEGIR.RowSource = "select id from dbo_Departamento"
Else
ELEGIR.RowSource = "select uDepartamento from a"
End If
End Sub
Private Sub Form_Current()
última = DLast("uDepartamento", "a")
End Sub