|
8#
楼主 |
发表于 2007-4-11 06:55:00
|
只看该作者
If cq > 0.01 Then
inta = 0
inidq = Now() - Me.»õµ½¸¶¿îÌìÊý
rs.Open "²éѯ½á¹û", CurrentProject.Connection, adOpenKeyset, adLockOptimistic
rs.MoveFirst
inida = rs("·¢ÉúÈÕÆÚ")
rs.MoveLast
Do Until rs.Fields("·¢ÉúÈÕÆÚ") < inidq
inid = rs("·¢ÉúÈÕÆÚ")
If inid = inida Then
MsgBox FormatDateTime(inid, vbLongDate) & "֮ǰûÓгö»õ¼Ç¼"
Exit Do
End If
rs.MovePrevious
Loop
Do Until inta >= (cq - 0.01) * 10000
inta = inta + rs("³ö»õ½ð¶î")
inid = rs("·¢ÉúÈÕÆÚ")
If inid = inida Then
MsgBox FormatDateTime(inid, vbLongDate) & "֮ǰûÓгö»õ¼Ç¼"
Exit Do
End If
rs.MovePrevious
Loop
strsqlcq = "select * from ²éѯ½á¹û where ·¢ÉúÈÕÆÚ<= #" & inidq & "# and ·¢ÉúÈÕÆÚ>= #" & inid & "# and ³ö»õ½ð¶î<>0"
Me.³¬ÆÚ²éѯ×Ó´°Ìå.Form.RecordSource = strsqlcq
Me.³¬ÆÚ²éѯ×Ó´°Ìå.Requery
MsgBox FormatDateTime(inid, vbLongDate) & "֮ǰûÓгö»õ¼Ç¼"
Else
strWhere = ""
strWhere = strWhere & "([¿Í»§Ãû³Æ] like '" & "³õʼ×Ó´°Ìå²»ÏÔʾÈκÎÄÚÈÝ" & "')"
Me.³¬ÆÚ²éѯ×Ó´°Ìå.Form.Filter = strWhere
Me.³¬ÆÚ²éѯ×Ó´°Ìå.Form.FilterOn = True
End If
|
|