Visual basic
BUENAS NOCHES ! Me sale un error al dale al boton para hacer una busqueda de cedula en vb6 "no se han especificado valores para alguno de los parametros requeridos"
Private Sub cmbbuscar_Click()
cedcompleta = cmbced + txtced
If Trim(txtced.Text) = "" Then
MsgBox "Debe introducir una cedula para realizar la busqueda", vbInformation + vbOKOnly
txtced.SetFocus
Else
If cmbced.Text = "" Then
MsgBox "Campo incompleto seleccione tipo de CI o RIF", vbInformation + vbOKOnly
cmbced.SetFocus
Else
sql = "Select CLNombre,CLFechaNac,CLEsatura,CLPeso,CLDir,CLSexo,CLEdoCIvil FROM TCliente where CLCIRif= '" & cedcompleta & "' "
Set rs = New ADODB.Recordset
rs.Open sql, db, adOpenStatic (JUSSSTO AQUI ME MARCA AMARILLO COMO ERROR)
If Not (rs.EOF Or rs.BOF) Then 'se encontro la cedula
txtnombre.Text = rs!CLNombre
dtpFechaNac.Value = rs!CLFechaNac
txtestatura.Text = rs!CLEstatura
txtpeso.Text = rs!CLPeso
txtdireccion.Text = rs!CLDir
cmbsexo.Text = rs!CLSexo 'en el combo box nose si trae .value??
cmbedocivil.Text = rs!CLEdoCivil
Else 'no lo encontro
If MsgBox("Cedula o Cliente no encontrado,desea registrarlo?", vbInformation + vbYesNo) = vbYes Then
txtnombre.Enabled = True
dtpFechaNac.Enabled = True
cmbsexo.Enabled = True
cmbedocivil.Enabled = True
txtestatura.Enabled = True
txtpeso.Enabled = True
txtdireccion.Enabled = True
txtemail.Enabled = True
txttlfhab.Enabled = True
txttlfofi.Enabled = True
txttlfcel.Enabled = True
End If
End If
End If
End If
End Sub
Private Sub Form_Load()
Set rs = New ADODB.Recordset
Set db = New ADODB.Connection
db.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\ProyectoSeguros\dbseguros.mdb;Persist Security Info=False"
txtnombre.Enabled = False
dtpFechaNac.Enabled = False
cmbsexo.Enabled = False
cmbedocivil.Enabled = False
txtestatura.Enabled = False
txtpeso.Enabled = False
txtdireccion.Enabled = False
txtemail.Enabled = False
txttlfhab.Enabled = False
txttlfofi.Enabled = False
txttlfcel.Enabled = False
End Sub
Private Sub cmbbuscar_Click()
cedcompleta = cmbced + txtced
If Trim(txtced.Text) = "" Then
MsgBox "Debe introducir una cedula para realizar la busqueda", vbInformation + vbOKOnly
txtced.SetFocus
Else
If cmbced.Text = "" Then
MsgBox "Campo incompleto seleccione tipo de CI o RIF", vbInformation + vbOKOnly
cmbced.SetFocus
Else
sql = "Select CLNombre,CLFechaNac,CLEsatura,CLPeso,CLDir,CLSexo,CLEdoCIvil FROM TCliente where CLCIRif= '" & cedcompleta & "' "
Set rs = New ADODB.Recordset
rs.Open sql, db, adOpenStatic (JUSSSTO AQUI ME MARCA AMARILLO COMO ERROR)
If Not (rs.EOF Or rs.BOF) Then 'se encontro la cedula
txtnombre.Text = rs!CLNombre
dtpFechaNac.Value = rs!CLFechaNac
txtestatura.Text = rs!CLEstatura
txtpeso.Text = rs!CLPeso
txtdireccion.Text = rs!CLDir
cmbsexo.Text = rs!CLSexo 'en el combo box nose si trae .value??
cmbedocivil.Text = rs!CLEdoCivil
Else 'no lo encontro
If MsgBox("Cedula o Cliente no encontrado,desea registrarlo?", vbInformation + vbYesNo) = vbYes Then
txtnombre.Enabled = True
dtpFechaNac.Enabled = True
cmbsexo.Enabled = True
cmbedocivil.Enabled = True
txtestatura.Enabled = True
txtpeso.Enabled = True
txtdireccion.Enabled = True
txtemail.Enabled = True
txttlfhab.Enabled = True
txttlfofi.Enabled = True
txttlfcel.Enabled = True
End If
End If
End If
End If
End Sub
Private Sub Form_Load()
Set rs = New ADODB.Recordset
Set db = New ADODB.Connection
db.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\ProyectoSeguros\dbseguros.mdb;Persist Security Info=False"
txtnombre.Enabled = False
dtpFechaNac.Enabled = False
cmbsexo.Enabled = False
cmbedocivil.Enabled = False
txtestatura.Enabled = False
txtpeso.Enabled = False
txtdireccion.Enabled = False
txtemail.Enabled = False
txttlfhab.Enabled = False
txttlfofi.Enabled = False
txttlfcel.Enabled = False
End Sub
1 Respuesta
Respuesta de asderpunk
1