Solved

How do I set an Alarm?

Posted on 2000-03-04
2
161 Views
Last Modified: 2010-05-02
I have a time program that I wrote (in VB 6). It shows the time of several major cities around the world on a map.

I made a menu item listing all of the cities on the map, and now I want to make it so that users can enter an alarm for each time zone through the menu.  I would like more than one alarm per time zone, but one at least.

If it were at all possible, I would like to be able to archive the message that the user enters with their alarm, so that they could edit or delete them if they wanted to.

I am lost now.  Any idea....  I am a beginner!
0
Comment
Question by:CnC
2 Comments
 
LVL 9

Expert Comment

by:Ruchi
ID: 2584429
There is a program on your CD or in your pc -- C:\Program Files\Microsoft Visual Studio\MSDN...\Alarm\Alarm. This might help you how to set alarm.
0
 
LVL 12

Accepted Solution

by:
roverm earned 100 total points
ID: 2590526
Place a timer on your form and set the interval to 1000 (millisecs).
Then in the Timer1_Timer irritate through an array containting possible alarm-times:

Private Sub Timer1_Timer()
Dim counter As Integer

    Timer1.Enabled = False 'disable timer
   
    For counter = 0 To UBound(MyArray)
        If CStr(Time) = MyArray(counter) Then Call GoAlarm(counter)
    Next counter
   
    Timer1.Enabled = True 'enable timer
   
End Sub

Every second the times are checked.
The alarm-times are placed (as a string) in MyArray(0...Ubound).

The GoAlarm sub plays an alarmsound, gives visual notification and so on. With the parameter passed to it you can collect the text the user entered from another array.

Of course you can use a recordset or a collection instead of an array, this is just an example!

Good luck!

D'Mzzl!
RoverM
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now