paso a paso....
Publicado por Maria (4 intervenciones) el 05/09/2007 15:44:26
Ya no me da el error, pero nunca me devuelve registros....
Private Sub Form_AfterUpdate()
Dim rs As DAO.Recordset
Dim x As String
ReferenciaMecanizada.SetFocus
x = ReferenciaMecanizada.Text
Set rs = CurrentDb.OpenRecordset("SELECT Elementos.Codigo, Elementos.Tipo, Elementos.Ubicacion, Elementos.Medida, Max(Inspeccion.ProximaCalibracion) AS MáxDeProximaCalibracion FROM (Referencia INNER JOIN Caja ON Referencia.ReferenciaMecanizada = Caja.ReferenciaMecanizada) INNER JOIN ((Elementos INNER JOIN Inspeccion ON Elementos.Codigo = Inspeccion.Codigo) INNER JOIN Utiles ON Elementos.Codigo = Utiles.Codigo) ON Referencia.ReferenciaMecanizada = Utiles.ReferenciaMecanizada GROUP BY Elementos.Codigo, Elementos.Tipo, Elementos.Ubicacion, Elementos.Medida, Caja.ReferenciaMecanizada HAVING (((Max(Inspeccion.ProximaCalibracion))<Date()) AND ((Caja.ReferenciaMecanizada)= 'x'))")
If rs.RecordCount > 0 Then
MsgBox "Hay registros"
Else
MsgBox "No hay registros"
End If
End Sub
Private Sub Form_AfterUpdate()
Dim rs As DAO.Recordset
Dim x As String
ReferenciaMecanizada.SetFocus
x = ReferenciaMecanizada.Text
Set rs = CurrentDb.OpenRecordset("SELECT Elementos.Codigo, Elementos.Tipo, Elementos.Ubicacion, Elementos.Medida, Max(Inspeccion.ProximaCalibracion) AS MáxDeProximaCalibracion FROM (Referencia INNER JOIN Caja ON Referencia.ReferenciaMecanizada = Caja.ReferenciaMecanizada) INNER JOIN ((Elementos INNER JOIN Inspeccion ON Elementos.Codigo = Inspeccion.Codigo) INNER JOIN Utiles ON Elementos.Codigo = Utiles.Codigo) ON Referencia.ReferenciaMecanizada = Utiles.ReferenciaMecanizada GROUP BY Elementos.Codigo, Elementos.Tipo, Elementos.Ubicacion, Elementos.Medida, Caja.ReferenciaMecanizada HAVING (((Max(Inspeccion.ProximaCalibracion))<Date()) AND ((Caja.ReferenciaMecanizada)= 'x'))")
If rs.RecordCount > 0 Then
MsgBox "Hay registros"
Else
MsgBox "No hay registros"
End If
End Sub
Valora esta pregunta
0