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
Case ?
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
Visual Basic Classic
Last Comment
Martin Liss
8/22/2022 - Mon
Martin Liss
There's no way to give bonus points. The best you can do is to give an "A" grade but that's what's normally done anyhow.
Would a grid or other control on the form where the tasks for the day were listed and a checkbox next to each one that indicates competition be acceptable?
isnoend2001
ASKER
Would a grid or other control on the form where the tasks for the day were listed and a checkbox next to each one that indicates competition be acceptable?
Have to give this more thought. what would the checkbox do?
more concerned with
gintDailyReminder may not apply it may be zero then
Case ? Msgbox "It's time to take your medicine"'
also need a way to stop the messages when the task is done for each day
Martin Liss
The column above the reminders would say "Today's Reminders" and the heading above the checkboxes would say "Done" and helpText for it would say "If you've followed up on the reminder, check the box".
In any case if the box were checked the 1 hour, two hour and/or whatever other warnings were associated with the event could be stopped.
If gintDailyReminder is 0, what do you want to have happen?
If gintDailyReminder is 0, what do you want to have happen?
Msgbox "Its time to take your medicine"
There are reminders, and a past due but missing is
at the time is is scheduled
there is a reminder 2 hours before and 1 hour before,but nothing at the time it is due.
Are you referring to a msflexgrid?
with each row or rows if more than one scheduled task(s) ?
Martin Liss
Yes I'm referring to an msflexgrid and there would be one row for each task that was due to happen today.
I just thought of something. We've been talking about a file called dy0900.rtf and reminders that say "It's time to take your medicine"'. Surely all the reminders can't be about medicine can they? If not then where are the descriptions of the tasks stored?
isnoend2001
ASKER
Actually The reminder i have made for yearly actually opens the rtf and
the reminders say "You have a task due in 2 days" etc and a label
Thanks Marty
It will take me some time to look it over, i notice you are basing the time calculation on seconds.
Martin Liss
i notice you are basing the time calculation on seconds.
Yes, that's the only way I could think of to prevent a 2-hour or 1-hour reminder msgbox from appearing every 10 seconds.
BTW you should delete line 24.
isnoend2001
ASKER
Really got a curve thrown to me of coding this
Went wit my sister to the doc today and he prescribed medicine for her to take before bed time.
so now she needs a reminder in the am and pm
Would a grid or other control on the form where the tasks for the day were listed and a checkbox next to each one that indicates competition be acceptable?