Ver Mensaje Individual
  #3 (permalink)  
Antiguo 15/03/2011, 15:04
Avatar de lokoman
lokoman
 
Fecha de Ingreso: septiembre-2009
Mensajes: 502
Antigüedad: 14 años, 7 meses
Puntos: 47
Respuesta: filtros con calendarios?

Hola!! Adapta el Code:
Código vb:
Ver original
  1. Sub Consultar()
  2.     Dim strConn As String
  3.     Dim strConsultar As String
  4.     On Error GoTo errores
  5.     strConn = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;"
  6.     strConn = strConn & "Initial Catalog=" & Trim(cboBaseDatos.Text)
  7.     Adodc1.ConnectionString = strConn
  8.  
  9.     strConsultar = "Select * From asistencia where fecha='" & varFECHA & "'"
  10.  
  11.     Adodc1.RecordSource = strConsultar
  12.     DataGrid.ClearFields
  13.     DataGrid.ReBind
  14.  
  15.     Adodc1.Refresh
  16.  
  17.     If Adodc1.Recordset.BOF <> True Or Adodc1.Recordset.EOF <> True Then
  18.         Adodc1.Recordset.MoveFirst
  19.         Adodc1.Refresh
  20.     Else
  21.         MsgBox "No se encontraron registros.", vbInformation
  22.         Adodc1.Refresh
  23.         Exit Sub
  24.     End If
  25.  
  26. Exit Sub
  27. Errores:
  28.     subErrores
  29. End Sub