Solved

How do I set an Alarm?

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Reading the Contents of a Directory In Access VBA 5 77
Put text in a picture ASP.NET C# 2 61
SLMGR Switches Are Not Working On KMS Host 3 110
Set WorkSheet  not Working 9 39
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…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…

856 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