vba help required

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tusharthakar
    New Member
    • Feb 2010
    • 2

    vba help required

    i want to know how to add live time that updates every second while your on the form

    second thing i want to ask is that i have a listbox which has valuelist as data type and i am using sql query to find the data and storing the data in record set and then using a loop i am going through each and every data and adding it to the list box

    the listbox has 4 column

    1st is id, second is name, third is qty, and last one is unitprice.

    i want to do total of (qty*unitprice) for every record in the recordset

    thank you in advance :)
  • missinglinq
    Recognized Expert Specialist
    • Nov 2006
    • 3533

    #2
    Here's a thing I use that addresses your first question. You'll need a textbox called txtOmega (yeah, I'm a watch fanatic) and you'll maybe want to add some cosmetics to it, like a frame around it. If you'd also like to show the date, add a textbox called txtDayRunner and uncomment the line

    'Me.txtDayRunne r = Date 'Display date

    Goto your form's property box. Under the Event Tab find Timer Interval and enter 1000.

    Code:
    Private Sub Form_Open(Cancel As Integer)
    'Displays while waiting for timer to crank up    
         Me.txtOmega = Time 
    End Sub
    
    Private Sub Form_Timer()
        Me.txtOmega = Time 'Display time
       ' Me.txtDayRunner = Date 'Display date
    End Sub
    Welcome to Bytes!

    Linq ;0)>

    Comment

    Working...