bueno asi calientico sera esto lo que buscas
en un modulo.................
Código:
Global ors As ADODB.Recordset
Global ocnn As New ADODB.Connection
Global oCmd As New ADODB.Command
despues
Código:
sub buscar()
dim str as string
dim buscando
abrirBD
buscando = InputBox("Ingrese el numro a Buscar")
Set ors = New ADODB.Recordset
oCmd.CommandType = adCmdText
oCmd.CommandText = "select campo1,campo2,campo3 from tabla where numero="& buscando
Set ors = oCmd.Execute
if not ors.eof then
text1.text=ors.fields!campo1
text2.text=ors.fields!campo2
text3.text=ors.fields!campo3
end if
end sub
Código:
Sub abrirBD()
Set ors = New ADODB.Recordset
Set ors = New ADODB.Recordset
If ocnn.State = adestateclose Then
ocnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\misdatos.mdb;Persist Security Info=False"
Set oCmd.ActiveConnection = ocnn
End If
End Sub
espero te sirva
nos vemos