Private Sub Timer3_Timer()
strgoods = "select * from Stock where val(Quantity)> val(Max_Quantity)"
rs_goods.Open strgoods, conn, adOpenKeyset, adLockPessimistic
If rs_goods.RecordCount > 0 Then
Beep
MsgBox "Some of the excessive number of products in stock ,please check !", vbOKOnly + vbInformation, "warning"
Timer3.Enabled = False
frmAlarm.Show
rs_goods.Close
Exit Sub
End If
'rs_goods.Close
End SubPrivate Sub Timer4_Timer()
strgoods = "select * from Stock where val(Quantity)<val(Min_Quantity)"
rs_goods.Open strgoods, conn, adOpenKeyset, adLockPessimistic
If rs_goods.RecordCount > 0 Then
Beep
MsgBox "Some of the derisory number of products in stock ,please check !", vbOKOnly + vbInformation, "warning"
Timer4.Enabled = False
frmAlarm.Show
rs_goods.Close
Exit Sub
End If
'rs_goods.Close
End SubPrivate Sub Timer5_Timer()
strgoods = "select * from Purchase where Expire < #" & Format(Now, "yyyy-mm-dd") & "# "
rs_goods.Open strgoods, conn, adOpenStatic, adLockOptimistic
If rs_goods.RecordCount > 0 Then
Beep
MsgBox "Some products have expired,Please check ", vbOKOnly + vbInformation, "Warning"
Timer5.Enabled = False
frmAlarm.Show
rs_goods.Close
Exit Sub
End If
'rs_goods.Close
End SubPrivate Sub Timer6_Timer()
strgoods = "SELECT * FROM Purchase WHERE Expire > #" & Format(Date, "yyyy-mm-dd") & "# AND Expire < #" & Format(Date + 30, "yyyy-mm-dd") & "#"
rs_goods.Open strgoods, conn, adOpenStatic, adLockOptimistic
If rs_goods.RecordCount > 0 Then
Beep
MsgBox "Some products are about to expire, please ckeck!", vbOKOnly + vbInformation, "Warning"
Timer6.Enabled = False
frmAlarm.Show
'rs_goods.Close
Exit Sub
End If
rs_goods.Close
End Sub