Solved

How do I set an Alarm?

Posted on 2000-03-04
2
153 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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
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…

763 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

12 Experts available now in Live!

Get 1:1 Help Now