Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a program to keep time

Status
Not open for further replies.

isthisthingon

IS-IT--Management
May 17, 2005
65
US
Here's what I need. I recently agreed to help a local volunteer ems agency implement tablet pc's, gps and field data collection in their vehicles. Simple enough.

They asked me to create a program where their personnel can click on one of five buttons and have the screen display the current system time once the button is clicked. These five buttons would keep track of the time they are enroute to a call, at the call, from the call to the hospital, at the hospital and then back in service from the hospital. I'd like a simple box with the five buttons, then once clicked, the time would appear next to that button. Then obviously a button to clear all times.

My expertise is networking, access development with minimal vb, asp.net and html. Please point me in the right direction, I think this is straight forward but I am a vb-nincompoop. Thanks in advance.
 
For 'experimentation' reasons...

1. Create a new vb project.
2. On the form, but a command button and a label
3. Double click the button (the code window will appear).
4. Copy/paste this code...

Code:
Label1.Caption = Time

Now, run the program and click the button. It really is that simple. [smile]

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 



Hi,

May you not have multiple symultaneous events?

Why not record the date & time at both ends and calculate the duration?

Skip,
[sub]
[glasses] [red][/red]
[tongue][/sub]
 
I like George's idea (except that I would use [red]Label1.Caption = Now[/red] to handle rolling over midnight.)

You will need to take care of things like them clicking buttons out of sequence (e.g. "at the call" clicked when the preceding button was "arrived at hospital"). Perhaps you want only one button and your system keeps track of where they are in the sequence.
 
Isthisthingon,

As a memeber of a local volunteer ems unit, I will help you all I can. I will put some simple stuff together and for the sake of the integrity of this form will post it here. Basically you have received very good advice from the others. Give me a bit and I will post something for you.



Andy Baldwin

"Testing is the most overlooked programming language on the books!"

Ask a great question, get a great answer. Ask a vague question, get a vague answer.
Find out how to get great answers FAQ219-2884.
 
Wanna hear something funny...

My first 'real' job out of college was to develop a system for EMS data collection. I wrote a product called KEMS that eventually was used by over 100 ambulance squads. I left that company about 10 years ago because they wanted to re-write their DOS application (written in Clipper) to windows. Instead of having me re-write it in VB, they decided to pay some outside contractor to write it in FoxPro. I got upset and left the company.

Suffice to say, there is software out there that you can purchase to do exactly what you want without you having to write it. You'll benefit by having software with more features than you can think of.

I suggest you start your search here:
Originally, this company had billing software. Since then, they have expanded in to trip reporting software. I haven't dealt with them in years, but they are a reputable company that has been in business for a long time.

Whatever you decide to do, I wish you luck.

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Here is a link to a sample form picture


4 buttons and labels with names of
cmdReceivedCall lblRecCall
cmdArrive lblAtCall lblAtCallElapsed
cmdEnroute lblEnroute lblEnrouteElapsed
cmdInSerivce lblRetServ lblRetServElapsed

Here is the code


Option Explicit

Private Sub cmdArrive_Click()
lblAtCall.Caption = Now()
lblAtCallElapsed.Caption = DateDiff("n", lblRecCall.Caption, lblAtCall.Caption)

cmdArrive.Enabled = False

End Sub

Private Sub cmdEnroute_Click()
lblEnroute.Caption = Now()
lblEnrouteElapsed.Caption = DateDiff("n", lblAtCall.Caption, lblEnroute.Caption)
cmdEnroute.Enabled = False
End Sub

Private Sub cmdInService_Click()
lblRetServ.Caption = Now()
'need some checking here to see if there was an enroute entry.
'If not check for arrival time
'If no arrival use received call time (as the call was cancelled)

lblRetServElapsed.Caption = DateDiff("n", lblEnroute.Caption, lblRetServ.Caption)

cmdReceivedCall.Enabled = True
cmdArrive.Enabled = True
cmdEnroute.Enabled = True

End Sub

Private Sub cmdReceivedCall_Click()
lblRecCall.Caption = Now()
cmdReceivedCall.Enabled = False

End Sub


The grid at the bottom and a few more labels should be added. The thing you would probably want to explore is to write the times to a database (which could be viewed in the grid, and to have the received call generate a call number to tie the records together in the db.

This should get you started.



Andy Baldwin

"Testing is the most overlooked programming language on the books!"

Ask a great question, get a great answer. Ask a vague question, get a vague answer.
Find out how to get great answers FAQ219-2884.
 
Thanks for the tremendous response!!!! I am trying some things here, but it tells me Caption is not a member of "System.Windows.Forms.Label" Any ideas? Thanks again all!!!!!
 
>Any ideas?

Yes, it looks like you are in the wrong forum ... you want forum796, which is for VB.NET (which is what it now looks like you are using)
 
Sorry all!!! I used the text parameter instead of the Caption parameter and all is ok so far. I'm sure I'll post again. Thanks for all the support.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top