ME PUEDEN EXPLICAR ESTE CODIGO LINE POR LINEA
Option Explicit
-------------------------------------------------------------------------------
Private Sub cboName_Click() ' Este el nombre del Combo
' Load the selected record.
datPeople.RecordSource = _ ' datPeople es el Control Data
"SELECT * FROM People WHERE Name='" & _ ' People nombre de la Tabla a consultar y "Name" creo que es uno de los campos de la Tabla
cboName.Text & "'"
datPeople.Refresh
End Sub
--------------------------------------------------------------------------------
Private Sub Form_Load()
Dim dbname As String
Dim db As Database ' A veces me marca error (objeto no difinido)
Dim rs As Recordset
' Open the database.
dbname = App.Path
If Right$(dbname, 1) <> "" Then dbname = dbname & ""
dbname = dbname & "data.mdb"
Set db = OpenDatabase(dbname)
Set rs = db.OpenRecordset( _
"SELECT Name FROM People ORDER BY Name", _
dbOpenSnapshot)
' Load the ComboBox.
rs.MoveFirst
Do While Not rs.EOF
cboName.AddItem rs!Name
rs.MoveNext
Loop
rs.Close
db.Close
' Connect the Data control to the database.
datPeople.DatabaseName = dbname
' Select the first choice.
cboName.ListIndex = 0
End Sub
--------------------------------------------------------------------------