Ayuda
Publicado por Marco (20 intervenciones) el 09/03/2006 15:39:20
SE CAE Y ME DICE POCOS PARAMETROS SE ESPERABA 1 GRACIAS.
Private Sub Buscar_Click()
Dim con As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim txtsql As String
con.Open ("dsn=fsgprestamos")
txtsql = "select * from prestamos where rcm=" & Val(Text1.Text) & ""
If Text1.Text = "" Then
MsgBox "DEBE INGRESAR RCM"
Else
Set rs = con.Execute(txtsql)
If rs.EOF = False Then
Adodc1.RecordSource = txtsql
Adodc1.Refresh
con.Close
con.Open ("dsn=fsgprestamos")
txtsql = "select * from medicos where rcm=" & Val(Text1.Text) & ""
Set rs = con.Execute(txtsql)
If rs.EOF = False Then
Adodc2.RecordSource = txtsql
Adodc2.Refresh
Text2 = rs!nombre1
Text3 = rs!nombre2
Text4 = rs!ape_pat
Text5 = rs!ape_mat
Text6 = rs!condicion_vital
Text7 = rs!numerofsg
Text8 = rs!descripcion
con.Close
con.Open ("dsn=fsgprestamos")
txtsql = "select * from contrato where rcm=" & Val(Text1.Text) & ""
Set rs = con.Execute(txtsql) ' AQUI SE CAE
If rs.EOF = False Then
Adodc3.RecordSource = txtsql
Adodc3.Refresh
Text9 = rs!idestamento
Text10 = rs!condicion
con.Close
If Text6.Text = 222 Then
Text6.Text = "VIVO"
Else
If Text6.Text = 223 Then
Text6.Text = "FALLECIDO"
End If
End If
Exit Sub
End If
End If
End If
End If
End Sub
Private Sub Buscar_Click()
Dim con As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim txtsql As String
con.Open ("dsn=fsgprestamos")
txtsql = "select * from prestamos where rcm=" & Val(Text1.Text) & ""
If Text1.Text = "" Then
MsgBox "DEBE INGRESAR RCM"
Else
Set rs = con.Execute(txtsql)
If rs.EOF = False Then
Adodc1.RecordSource = txtsql
Adodc1.Refresh
con.Close
con.Open ("dsn=fsgprestamos")
txtsql = "select * from medicos where rcm=" & Val(Text1.Text) & ""
Set rs = con.Execute(txtsql)
If rs.EOF = False Then
Adodc2.RecordSource = txtsql
Adodc2.Refresh
Text2 = rs!nombre1
Text3 = rs!nombre2
Text4 = rs!ape_pat
Text5 = rs!ape_mat
Text6 = rs!condicion_vital
Text7 = rs!numerofsg
Text8 = rs!descripcion
con.Close
con.Open ("dsn=fsgprestamos")
txtsql = "select * from contrato where rcm=" & Val(Text1.Text) & ""
Set rs = con.Execute(txtsql) ' AQUI SE CAE
If rs.EOF = False Then
Adodc3.RecordSource = txtsql
Adodc3.Refresh
Text9 = rs!idestamento
Text10 = rs!condicion
con.Close
If Text6.Text = 222 Then
Text6.Text = "VIVO"
Else
If Text6.Text = 223 Then
Text6.Text = "FALLECIDO"
End If
End If
Exit Sub
End If
End If
End If
End If
End Sub
Valora esta pregunta


0