Join 109,558 VB Programmers for FREE! Ask your question and get quick answers from experts. There are 1,371 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!
hi guys.. is it possible to make a msgbox box with timer? the user will need not to press the msgbox in order to execute the next line of the program.. i try this but i got wrong expected output..
Well first you have to setup the timer's tick event which in there you call the message box. However, the msgbox is modal meaning that it requires the user to interact with it before it continues to process any other lines of code. So you will have to come up with another way to do what you are looking to do.
But you really have to ask yourself if showing a message box every so many ticks on the timer is even a good idea. You shouldn't hit the user with msgboxes like this. Reserve the messagebox only for showing extremely important information that would the intervention of the user.
If you want to elaborate on what you are attempting to do, perhaps we can help further.
Hope that helps you make the correct design choice.
Well first you have to setup the timer's tick event which in there you call the message box. However, the msgbox is modal meaning that it requires the user to interact with it before it continues to process any other lines of code. So you will have to come up with another way to do what you are looking to do.
But you really have to ask yourself if showing a message box every so many ticks on the timer is even a good idea. You shouldn't hit the user with msgboxes like this. Reserve the messagebox only for showing extremely important information that would the intervention of the user.
If you want to elaborate on what you are attempting to do, perhaps we can help further.
Hope that helps you make the correct design choice.
tnx for the reply..
my real problem is this.. i hav this difficulty in refreshing the database.. i hav two option button which will display daily record and monthly record respectivetly.. when i press the option 1 the daily records appear but once i pressed the second button, this where my problem occurs, it did not display the monthly reports, i must terminate first my progrma then re-do what i did.. what shuold i do with this? help me pls.. hope you understood what i meant.. bad english..
Is this straight VB6 or are you implementing this through Excel/Access etc? Are you using crystal reports? Can you show us your code that is giving you the problems?
Is this straight VB6 or are you implementing this through Excel/Access etc? Are you using crystal reports? Can you show us your code that is giving you the problems?
Thanks.
heres my code:
CODE
Private Sub Option1_Click() Dim rs1 As New Recordset
ucon.Execute "Delete * from Tmp"
Set urec = Nothing
urec.Open "select * from courses", ucon, adOpenForwardOnly, adLockOptimistic
With urec
Do While Not .EOF If CDate(urec.Fields("datee")) = Date Then Set rs1 = Nothing rs1.Open "Select * from Tmp", ucon, adOpenDynamic, adLockOptimistic rs1.AddNew rs1!studnum = urec.Fields("course") rs1!numhr = urec.Fields("total") rs1!course = urec.Fields("datee") rs1.UpdateBatch adAffectCurrent
Else End If .MoveNext Loop
End With
MsgBox ("rEADY FOR pRINTING")
With rs1 DataReport2.Show End With
'With DataEnvironment1.rscourse ' If .State = adStateClosed Then .Open ' .Requery ' .Requery ' urec.Requery ' ' DataReport2.Show ' 'End With
'With DataReport1.Sections("Section4") ' .Controls("label14").Caption = "Daily Report" 'End With
Option1.Value = False End Sub
Private Sub Option2_Click() Dim rs2 As New Recordset
ucon.Execute "Delete * from Tmp" ucon.Execute "Delete * from Tmp"
Set urec = Nothing
urec.Open "select * from courses", ucon, adOpenForwardOnly, adLockOptimistic
With urec
Do While Not .EOF If Format(Month(urec.Fields("datee"))) = Format(Month(Now)) Then
'With DataEnvironment1.rscourse ' If .State = adStateClosed Then .Open ' .Requery ' .Requery ' urec.Requery ' DataReport2.Show
'End With
'With DataReport1.Sections("Section4") ' .Controls("label14").Caption = "Monthly Report" 'End With Option2.Value = False End Sub
i think, theres nothing wrong with the code, because it saves the data on the database, my only problem is displaying the correct data upon pressing the option button.. tell me pls.., if where i got wrong.. tnx..
hi guys.. is it possible to make a msgbox box with timer? the user will need not to press the msgbox in order to execute the next line of the program.. i try this but i got wrong expected output..
CODE
msgbox timer1
help me guys pls.. tnx..
please you use Windows Api
Private Declare Function MessageBoxTimeout Lib "user32.dll" Alias "MessageBoxTimeoutA" ( _ ByVal hwnd As Long, _ ByVal lpText As String, _ ByVal lpCaption As String, _ ByVal uType As Long, _ ByVal wLanguageId As Long, _ ByVal dwMilliseconds As Long _ ) As Long
Private Sub Form_Load() Dim lRet As Long lRet = MessageBoxTimeout(0&, "your message", _ "Timeout MessageBox Test", MB_SETFOREGROUND Or MB_YESNO Or MB_ICONASTERISK, _ 0&, 10000&)
Select Case lRet Case IDYES: '// your code Case IDNO: '// your code
hi guys.. is it possible to make a msgbox box with timer? the user will need not to press the msgbox in order to execute the next line of the program.. i try this but i got wrong expected output..
CODE
msgbox timer1
help me guys pls.. tnx..
please you use Windows Api
Private Declare Function MessageBoxTimeout Lib "user32.dll" Alias "MessageBoxTimeoutA" ( _ ByVal hwnd As Long, _ ByVal lpText As String, _ ByVal lpCaption As String, _ ByVal uType As Long, _ ByVal wLanguageId As Long, _ ByVal dwMilliseconds As Long _ ) As Long
Private Sub Form_Load() Dim lRet As Long lRet = MessageBoxTimeout(0&, "your message", _ "Timeout MessageBox Test", MB_SETFOREGROUND Or MB_YESNO Or MB_ICONASTERISK, _ 0&, 10000&)
Select Case lRet Case IDYES: '// your code Case IDNO: '// your code
hi guys.. is it possible to make a msgbox box with timer? the user will need not to press the msgbox in order to execute the next line of the program.. i try this but i got wrong expected output..
CODE
msgbox timer1
help me guys pls.. tnx..
please you use Windows Api
Private Declare Function MessageBoxTimeout Lib "user32.dll" Alias "MessageBoxTimeoutA" ( _ ByVal hwnd As Long, _ ByVal lpText As String, _ ByVal lpCaption As String, _ ByVal uType As Long, _ ByVal wLanguageId As Long, _ ByVal dwMilliseconds As Long _ ) As Long
Private Sub Form_Load() Dim lRet As Long lRet = MessageBoxTimeout(0&, "your message", _ "Timeout MessageBox Test", MB_SETFOREGROUND Or MB_YESNO Or MB_ICONASTERISK, _ 0&, 10000&)
Select Case lRet Case IDYES: '// your code Case IDNO: '// your code
guys... pls check mycodes where i get wrong.. i got stuck up here in displaying the records in the database.. hope you cuold help me on this.. thanks..
I assume DataReport2 is a form? I see you showing it but no where are you looping through your recordset and adding each record to some kind of control.
Are you completely stumped about this part and don't know where to start? Or are you having some issue with putting the data into a particular control? Be descriptive as to what you want to read and where you want the data to be shown.
I assume DataReport2 is a form? I see you showing it but no where are you looping through your recordset and adding each record to some kind of control.
Are you completely stumped about this part and don't know where to start? Or are you having some issue with putting the data into a particular control? Be descriptive as to what you want to read and where you want the data to be shown.
Thanks.
tnx for the reply.. i figure out already where i got wrong.. i forgot to close recordset everytime i terminate data report.. anyway.. tnx po..