Solved

How do I set an Alarm?

Posted on 2000-03-04
2
165 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

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 Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

813 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

11 Experts available now in Live!

Get 1:1 Help Now