|
這個語句我是想,當我輸入一個日期時,讓它與LD_COLOUR_HISTROY表中的EVENT(事件)的APPROVED的日期相比較。
Private Sub txti_Change()
strSQL = "select * from [LD_COLOUR_HISTORY] where ([hld]='" & HLD_no.Value & "') and ([colour]='" & Colour.Value & "') and ([event]='approved')"and (colour='" & Colour.Value & "')"
rst.Open strSQL, CurrentProject.Connection, adOpenStatic, adLockReadOnly
Dim txti As Date, dt1 As Date
If rst("event") = "approved" Then dt1 = rst("date")
If (txti - dt1) > 0 Then
MsgBox "沒有超期,在客戶規定的期限內將樣品交出了!" & "txti-dt1"
ElseIf (txti - dt1) = 0 Then
MsgBox "剛好,在客戶規定的期限內將樣品交出了!" & "txti-dt1"
Else
MsgBox "超期警告!!!" & "txti-dt1"
End If
End Sub
|
|