473,408 Members | 2,813 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

upadate label TimeEnd and labelTime Start

Hi, can someone help me with the coding. I want to update the label TimeStart and label TmeEnd every 5 min. Can someone show how to do it. In this pogrom the label TimeStart only display first time when the form load but the label TimeStart not update with new time when msgbox revoke same goes to label EndTime. plz help me.
Expand|Select|Wrap|Line Numbers
  1. Private Sub Timer2_Timer()
  2. On Error Resume Next
  3.  
  4. Dim myvari As Integer
  5. Dim StartTime As Integer
  6. Dim StopTime As Integer
  7.  
  8. Dim Store As Integer
  9. Dim timeGap As Integer
  10. Dim avgSpeed As Long
  11. Dim NoOfCars As Integer
  12.  
  13.  
  14. If Timer2.Enabled = True Then
  15.  
  16.     GraphTimeIncrement = GraphTimeIncrement + 1
  17.  
  18.    If GraphTimeIncrement >= 1 Then
  19.  
  20.         GraphStopTime = DatePart("n", Now())
  21.         myvari = MsgBox("start time " & GraphStartTime & " Stop Time " & GraphStopTime, vbOKOnly)
  22.         frmDisplay.Show
  23.         lblTimeEnd.Caption = Format(Now, "hh:mm:ss")
  24.         frmDisplay.txtTimeEnd.Text = Format(Now, "hh:mm:ss")
  25.         If myvari = vbOK Then
  26.             frmMain.Refresh
  27.             Timer1.Enabled = True
  28.         End If
  29.  
  30.  
  31. DataRs.Open strSql, DE.Conn, adOpenForwardOnly, adLockReadOnly
  32.  
  33.         If DataRs.RecordCount > 0 Then
  34.             'NoOfCars = DataRs(0)
  35.             'avgSpeed = DataRs(1)
  36.         End If
  37.  
  38.         DataRs.Close
  39.  
  40.         strSql = "INSERT INTO RESULTS (TimeStart, TimeEnd, AverageSpeed, NoOfCars, TimeGap) " & _
  41.                     " VALUES ('" & lblTimeStart.Caption & "','" & lblTimeEnd.Caption & "','" & lblAverage & "'," & _
  42.                     " '" & lblNum.Caption & "'," & timeGap & ")"
  43.  
  44.                     DE.Conn.Execute strSql
  45.  
  46.         GraphTimeIncrement = 0
  47.         GraphStartTime = DatePart("n", Now())
  48.         GraphStopTime = 0
  49.     Else
  50.         Timer2.Enabled = True
  51.     End If
  52.  End If
  53. End Sub
Apr 30 '08 #1
0 960

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: Steve | last post by:
I'm not sure if I should be using tables here to structure the layout or if CSS is okay. I have a data entry form in which I have floated the labels to one side, and given them a specific width....
0
by: Adonai | last post by:
Hi, I'm having an issue with this code that I'm writing, I'm curious as to why the windows form label (lblTime) isn't getting updated with the new variable when I use the timer. I made a blank form...
1
by: Dave | last post by:
This is pretty basic but here goes: Is there a shortcut for typing text for a label? Every example I've seen requires you to go to the property window, select the name property value and then...
1
by: nospamjac | last post by:
Hi, Is there a way to update the text of an asp:label on a webform without refreshing the entire page? What is called by button clicks and other events that refresh a webform control? See the...
6
by: jcrouse | last post by:
I am rotating some text is some label controls. In the one place I use it it works fine. In the other place I use it I can't figure out the syntax. I don't really understand the event. Where it...
7
by: Dennis | last post by:
I have a control that inherits from the Panel Class. To this, I added a label which I want to use as a caption in my derived control. However, I can't get the label to show up in the panel. I...
3
by: Neil Wallace | last post by:
Hi, This is an odd one. I've been struggling to get "double click" to work well for my controls. The same event handler works perfectly for buttons, but not for labels. Can anyone tell me...
12
by: vbnewbie | last post by:
I am having problems accessing properties of dynamically generated objects in VB2005. Can someone please help? In a nutshell: My app creates an equal number of checkboxes and labels that share the...
3
by: bhanubalaji | last post by:
hi, I am unable to disable the text(label) in javascript..it's working fine with IE,but i am using MOZILLA.. can any one help regarding this.. What's the wrong with my code? I am...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.