|
|
 |
| 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.
|
 |

October 26th, 2009, 06:24 AM
|
|
Registered User
|
|
Join Date: Oct 2009
Posts: 6
Thanks: 2
Thanked 0 Times in 0 Posts
|
|
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
|

October 26th, 2009, 10:14 AM
|
|
Authorized User
|
|
Join Date: Mar 2009
Posts: 30
Thanks: 0
Thanked 5 Times in 5 Posts
|
|
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
|

October 28th, 2009, 05:48 AM
|
|
Registered User
|
|
Join Date: Oct 2009
Posts: 6
Thanks: 2
Thanked 0 Times in 0 Posts
|
|
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
|

October 28th, 2009, 08:46 AM
|
|
Registered User
|
|
Join Date: Oct 2009
Posts: 6
Thanks: 2
Thanked 0 Times in 0 Posts
|
|
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
|

October 28th, 2009, 11:40 AM
|
|
Authorized User
|
|
Join Date: Mar 2009
Posts: 30
Thanks: 0
Thanked 5 Times in 5 Posts
|
|
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
|
|
The Following User Says Thank You to vb5prgrmr For This Useful Post:
|
Janos (October 29th, 2009) |

October 29th, 2009, 02:35 AM
|
|
Registered User
|
|
Join Date: Oct 2009
Posts: 6
Thanks: 2
Thanked 0 Times in 0 Posts
|
|
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.
|

October 29th, 2009, 09:38 AM
|
|
Registered User
|
|
Join Date: Oct 2009
Posts: 6
Thanks: 2
Thanked 0 Times in 0 Posts
|
|
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
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |