p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).

Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 26th, 2009, 06:24 AM
Registered User
Points: 21, Level: 1
Points: 21, Level: 1 Points: 21, Level: 1 Points: 21, Level: 1
Activity: 12%
Activity: 12% Activity: 12% Activity: 12%
 
Join Date: Oct 2009
Posts: 6
Thanks: 2
Thanked 0 Times in 0 Posts
Default Label Refresh

Hi; I have a timer that executes my start button every 15 minutes which works fine but now I want the labels to refresh at the same time. I’ve played around a bit but and did search other posts but can’t seem to get it right, here’s what I’ve got.

Code:
Private Sub tmrMinute_Timer()
MinCount = MinCount + 1
Label1.Caption = MinCount
If (MinCount = 15) Then
Call cmdstart_Click
MinCount = 0
End If
lblMsgA.Refresh
lblMsgB.Refresh
lblMsgC.Refresh
lblMsgD.Refresh
End Sub
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old October 26th, 2009, 10:14 AM
Authorized User
Points: 150, Level: 2
Points: 150, Level: 2 Points: 150, Level: 2 Points: 150, Level: 2
Activity: 15%
Activity: 15% Activity: 15% Activity: 15%
 
Join Date: Mar 2009
Posts: 30
Thanks: 0
Thanked 5 Times in 5 Posts
Default

Those labels will only be refreshed after the code in the button has been executed. If you are wanting them to be updated while/from information from that code then you should put the refresh statements within that code or perhaps the dreaded by some, DoEvents.



Good Luck
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #3 (permalink)  
Old October 28th, 2009, 05:48 AM
Registered User
Points: 21, Level: 1
Points: 21, Level: 1 Points: 21, Level: 1 Points: 21, Level: 1
Activity: 12%
Activity: 12% Activity: 12% Activity: 12%
 
Join Date: Oct 2009
Posts: 6
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Thanks for that I have play around but can’t seem to get it right I don’t get the doevent that well where must I put it to do something because it’s not doing anything where it is now

Code:
Private Sub cmdstart_Click()
If lblMsgD <= 1000 Then
Dim olmahApp As Outlook.Application
   Set olmahApp = CreateObject("Outlook.Application")
    

   Dim olmahNs As Outlook.Namespace
   Set olmahNs = olmahApp.GetNamespace("MAPI")
   olmahNs.Logon
   

   Dim olmahMail As Outlook.MailItem
   Set olmahMail = olmahApp.CreateItem(olmahMailItem)
   olmahMail.To = "some@one.gov.za"
   olmahMail.Subject = "VB TEST"
   olmahMail.Body = _
        "Good Day Magoveni Holdings" & ", " & vbCr & vbCr & vbTab & _
        "Please note that your credit is all most finish ." & ", " & vbCr & vbCr & vbTab & _
        "Many Thanks"
   olmahMail.Send
   olmahNs.Logoff
   Set olmahNs = Nothing
   Set olmahMail = Nothing
   Set olmahApp = Nothing
End If
DoEvents
lblMsgA.Refresh
End Sub


Private Sub tmrMinute_Timer()
MinCount = MinCount + 1
Label1.Caption = MinCount
If (MinCount = 10) Then
Call cmdstart_Click
MinCount = 0
End If
End Sub
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #4 (permalink)  
Old October 28th, 2009, 08:46 AM
Registered User
Points: 21, Level: 1
Points: 21, Level: 1 Points: 21, Level: 1 Points: 21, Level: 1
Activity: 12%
Activity: 12% Activity: 12% Activity: 12%
 
Join Date: Oct 2009
Posts: 6
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Hi, I think I know what my problem is I need to refresh the form or the Adodc because the label gets updated from the date base throw the Adodc any suggestions will be appreciated
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #5 (permalink)  
Old October 28th, 2009, 11:40 AM
Authorized User
Points: 150, Level: 2
Points: 150, Level: 2 Points: 150, Level: 2 Points: 150, Level: 2
Activity: 15%
Activity: 15% Activity: 15% Activity: 15%
 
Join Date: Mar 2009
Posts: 30
Thanks: 0
Thanked 5 Times in 5 Posts
Default

Okay, if the label is bound to the ADODC then it is the ADODC that you need to refresh and if you do use this you will need to be able to keep track of where you are presently at in the recordset so you can move back to the current record you want to display...



Good Luck
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
The Following User Says Thank You to vb5prgrmr For This Useful Post:
Janos (October 29th, 2009)
  #6 (permalink)  
Old October 29th, 2009, 02:35 AM
Registered User
Points: 21, Level: 1
Points: 21, Level: 1 Points: 21, Level: 1 Points: 21, Level: 1
Activity: 12%
Activity: 12% Activity: 12% Activity: 12%
 
Join Date: Oct 2009
Posts: 6
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Thanks for the reply, Im only interested in the available credit left and the query in th record source provides that for me and display it in the label but this availble credit change every second so my goal is to refresh the ADODC lets say every 10 minutes. I’ve tried a couple of things but cant get it right how does n person go by doing this im lost here

Last edited by Janos : October 29th, 2009 at 03:06 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #7 (permalink)  
Old October 29th, 2009, 09:38 AM
Registered User
Points: 21, Level: 1
Points: 21, Level: 1 Points: 21, Level: 1 Points: 21, Level: 1
Activity: 12%
Activity: 12% Activity: 12% Activity: 12%
 
Join Date: Oct 2009
Posts: 6
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Thanks for the afford and the replays I got it sorted

Code:
 
adoeas.RecordSource = "select unit_id, (CREDIT_UPPER_LIMIT - CREDIT_ISSUED)Available_Credit from CREDIT_LIMIT where unit_id = 16251"
adoeas.Refresh
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to see a label hombre Java Basics 3 March 4th, 2008 06:15 AM
Refresh GridView Using Refresh Button msbsam ASP.NET 2.0 Professional 0 December 6th, 2006 05:57 AM
Detect associated label ysiline Access VBA 1 April 26th, 2006 08:16 AM
label in repeater boomsoftware@gmail.com ASP.NET 1.0 and 1.1 Basics 0 April 13th, 2006 10:38 AM
How to refresh datagrid without refresh whole page avanishp ASP.NET 1.1 1 September 13th, 2005 01:43 PM



All times are GMT -4. The time now is 04:00 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc