busqueda por fechas
Publicado por fabian (22 intervenciones) el 20/07/2007 16:28:11
tengo el siguiente codigo para buscar registros entre dos fechas pero me da error, me dice
error de compilacion "no se puede encontrar el proyecto o la biblioteca"
y me marca en negrita la palabra format
si alguien puede ayudarme a solucionar este problema se lo agradeceria.
Private Sub Comando10_Click()
Dim stDocName As String
stDocName = "informe"
If Me!fecha1 <> "" Then ' comprueba fecha de inicio contiene algo
txtFiltro = "[Tabla1]![Fecha] >= #" & format(Me.fecha1, "mm/dd/yy") & "#"
End If
If Me!fecha2 <> "" Then ' comprueba fecha de fin contiene algo
If txtFiltro = "" Then ' comprueba si ya hay algo en txtfiltro
txtFiltro = "[Tabla1]![Fecha] <= #" & Format(Me.fecha2, "mm/dd/yy") & "#"
Else
txtFiltro = txtFiltro & " and [Tabla1]![Fecha] <= #" & Format(Me.fecha2, "mm/dd/yy") & "#"
End If
End If
DoCmd.OpenReport stDocName, acPreview
Set inf = Reports("informe")
inf.FilterOn = True ' activa el filtro en el informe
inf.Filter = txtFiltro ' pasa los datos por los que filtrar
End Sub
error de compilacion "no se puede encontrar el proyecto o la biblioteca"
y me marca en negrita la palabra format
si alguien puede ayudarme a solucionar este problema se lo agradeceria.
Private Sub Comando10_Click()
Dim stDocName As String
stDocName = "informe"
If Me!fecha1 <> "" Then ' comprueba fecha de inicio contiene algo
txtFiltro = "[Tabla1]![Fecha] >= #" & format(Me.fecha1, "mm/dd/yy") & "#"
End If
If Me!fecha2 <> "" Then ' comprueba fecha de fin contiene algo
If txtFiltro = "" Then ' comprueba si ya hay algo en txtfiltro
txtFiltro = "[Tabla1]![Fecha] <= #" & Format(Me.fecha2, "mm/dd/yy") & "#"
Else
txtFiltro = txtFiltro & " and [Tabla1]![Fecha] <= #" & Format(Me.fecha2, "mm/dd/yy") & "#"
End If
End If
DoCmd.OpenReport stDocName, acPreview
Set inf = Reports("informe")
inf.FilterOn = True ' activa el filtro en el informe
inf.Filter = txtFiltro ' pasa los datos por los que filtrar
End Sub
Valora esta pregunta
0