Private Sub TimeCheck()Dim TimeDifference As String'dim TimeNow as ?Dim TaskTime As StringDim dteTaskTime As Date' I assume that this is defined someplace else so it's' not needed hereDim gintDailyReminder As Integer' I assume that TaskTime is the time at which she needs' to take her medicineTaskTime = 900 '9AMdteTaskTime = Left$(TaskTime, Len(TaskTime) - 2) & ":" & Right$(TaskTime, 2)' I assume that gintDailyReminder is the number of hours before' the task time that she should get the first messagegintDailyReminder = 2 'from ini file(Hours)' What is megintDailyReminder? Did you mean gintDailyReminder?'TaskTime = TaskTime - megintDailyReminderTimeDifference = Format(Time() - dteTaskTime, "HH:NN") 'gintDailyReminderSelect Case CInt(Left$(TimeDifference, 2)) - gintDailyReminderCase Is > 2 Exit SubCase 0 MsgBox "You need to take your medicine in 2 hours at " & Format(dteTaskTime, "HH:NN AM/PM") 'convert to AM/PMCase -1 MsgBox "You need to take your medicine in 1 hour at " & Format(dteTaskTime, "HH:NN AM/PM") 'convert to AM/PMCase Else MsgBox "You Forgot to take your medicine at " & Format(dteTaskTime, "HH:NN AM/PM") 'convert to AM/PEnd SelectEnd Sub
gintDailyReminder may not apply it may be zero then
Msgbox "It's time to take your medicine"'no reminder
also need a way to stop the messages when the task is done for each day
I will post the question
is there any way to give bonus points ? __Time-.zip
Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.