By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,665 Members | 2,646 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,665 IT Pros & Developers. It's quick & easy.

vba help required

P: 2
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 :)
Apr 6 '10 #1

✓ answered by missinglinq

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.txtDayRunner = Date 'Display date

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

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Open(Cancel As Integer)
  2. 'Displays while waiting for timer to crank up    
  3.      Me.txtOmega = Time 
  4. End Sub
  5.  
  6. Private Sub Form_Timer()
  7.     Me.txtOmega = Time 'Display time
  8.    ' Me.txtDayRunner = Date 'Display date
  9. End Sub
Welcome to Bytes!

Linq ;0)>

Share this Question
Share on Google+
1 Reply


missinglinq
Expert 2.5K+
P: 3,532
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.txtDayRunner = Date 'Display date

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

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Open(Cancel As Integer)
  2. 'Displays while waiting for timer to crank up    
  3.      Me.txtOmega = Time 
  4. End Sub
  5.  
  6. Private Sub Form_Timer()
  7.     Me.txtOmega = Time 'Display time
  8.    ' Me.txtDayRunner = Date 'Display date
  9. End Sub
Welcome to Bytes!

Linq ;0)>
Apr 6 '10 #2

Post your reply

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