Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 168
  • Last Modified:

timer

Hello,

I want create an app to reminder the user  abt his appointment(for eg : he has appointment with client 4 pm).So my app should popup a dialogbox at 4pm and remind him abt his appointment.Is it possible to do?. If yes, can some-one help me to do this.

Thanks
0
beeena
Asked:
beeena
  • 2
1 Solution
 
aelatikCommented:
' You can do it in many ways, here someting to start with...
' Add a timer control to your form and paste this code :

Private Sub Form_Load()
Timer1.Interval = 1000 ' per second
End Sub

Private Sub Timer1_Timer()
If Hour(Time) & ":" & Minute(Time) = "12:00" Then
MsgBox "It is 12:00 !!!", vbInformation
Timer1.Enabled = False ' app finished his task
End If
End Sub
0
 
supunrCommented:
Option Explicit

Private Type Appointment
    Description As String
    DateTime As Date
    Flag As Integer ' 0 - waiting, 1 - remind again, 2 - completed
End Type

Private Appointments(100) As Appointment
Private AppointmentsCount As Long

Private Sub Form_Load()
    ' Load all the saved appointments (may be from an dat file or registry)...
End Sub

' Add timer control to the form and set the interval to 1000 (1 sec)
Private Sub Timer1_Timer()
    Dim i As Long

    For i = 0 To AppointmentsCount - 1
        If (Appointments(i).Flag = 0) Then ' not done
            If (Abs(DateDiff("S", Appointments(i).DateTime, Now())) < 2) Then
                ShowMessage Appointments(i)
            End If
        End If
    Next i
End Sub

Private Sub ShowMessage(ByRef msgApp As Appointment)
    ' write your code to show the message
    ' have a non-modal form coming up rather than messagebox
    MsgBox msgApp.Description
    msgApp.Flag = 2 'done
End Sub

Private Sub Form_Unload(Cancel As Integer)
    ' Save all the appointments - because these could have been changed (may be from an dat file or registry)...
End Sub

Hope this will give a start.

Good Luck!
0
 
supunrCommented:

Yep, simply create an application which has the interface to get appointment details and times.  then you  create the executalbe and make a shortcut to that in the Startup folder.  Then you need a timer to check if the correct time has reached and if so give a reminder.

I am only giving you a possible code to check the time.  It is up to you how you want to get the details of the appointment from the user, etc. (If you need a full program, then increase the points)

(add to previous comment)
0
 
beeenaAuthor Commented:
Hello supunr
Can you now give me in detail the whole program along with code?
Appreciate your help
Thanks
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now