troubleshooting Question

modify a vb6 project

Avatar of isnoend2001
isnoend2001Flag for United States of America asked on
Visual Basic Classic
11 Comments1 Solution56 ViewsLast Modified:
Need modification to this code (see below code)
Private Sub TimeCheck()
Dim TimeDifference As String
'dim TimeNow as ?
Dim TaskTime As String
Dim dteTaskTime As Date

' I assume that this is defined someplace else so it's
' not needed here
Dim gintDailyReminder As Integer

' I assume that TaskTime is the time at which she needs
' to take her medicine
TaskTime = 900  '9AM
dteTaskTime = 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 message
gintDailyReminder = 2 'from ini file(Hours)

' What is megintDailyReminder? Did you mean gintDailyReminder?
'TaskTime = TaskTime - megintDailyReminder

TimeDifference = Format(Time() - dteTaskTime, "HH:NN") 'gintDailyReminder
Select Case CInt(Left$(TimeDifference, 2)) - gintDailyReminder
Case Is > 2
    Exit Sub
Case 0
  MsgBox "You need to take your medicine in 2 hours at " & Format(dteTaskTime, "HH:NN AM/PM") 'convert to AM/PM
Case -1
  MsgBox "You need to take your medicine in 1 hour at " & Format(dteTaskTime, "HH:NN AM/PM") 'convert to AM/PM
Case Else
  MsgBox "You Forgot to take your medicine at " & Format(dteTaskTime, "HH:NN AM/PM") 'convert to AM/P
End Select
End 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 ?
Join our community to see this answer!
Unlock 1 Answer and 11 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 11 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros