Gacha
September 9th, 2001, 07:16 PM
I am trying to find a date on a table if it is not found i add a new recordset with the date but if run the procedure again it does not find the date the code is as follows, please help
criterio = "Fecha = #" & Format(Date, "mm/dd/yy") & "#"
.FindFirst criterio 'This is where it fails to find the date
If .NoMatch Then
.AddNew
.Fields("Fecha").Value = Format(Date, "mm/dd/yy")
Else
.Edit
End If
.Fields("CntId").Value = rs3.Fields("CntId").Value
.Fields("Consumo").Value = .Fields("Consumo").Value + rs3.Fields("Qty").Value * (29.57 / 384) * factor * qty
.Update
End With
rs3.MoveNext
Loop
criterio = "Fecha = #" & Format(Date, "mm/dd/yy") & "#"
.FindFirst criterio 'This is where it fails to find the date
If .NoMatch Then
.AddNew
.Fields("Fecha").Value = Format(Date, "mm/dd/yy")
Else
.Edit
End If
.Fields("CntId").Value = rs3.Fields("CntId").Value
.Fields("Consumo").Value = .Fields("Consumo").Value + rs3.Fields("Qty").Value * (29.57 / 384) * factor * qty
.Update
End With
rs3.MoveNext
Loop