Results 1 to 36 of 36

Thread: [RESOLVED] MsgBox Timer on some Forms

  1. #1

    Thread Starter
    Hyperactive Member Couin's Avatar
    Join Date
    Dec 2020
    Posts
    272

    Resolved [RESOLVED] MsgBox Timer on some Forms

    Hi friends,

    I was in difficulties to run the progress information of cZipArchive class and after some search, I noticed that "Timer" has a wrong value.

    If I set a simple code :
    Private Sub CommandButton_click()
    MsgBox Timer
    End Sub

    It displays "False" instead of a value if I do the same on main form or some other forms.

    Created a simple Form1 with also the same button and it's ok.
    I searched for difference bewteen a form where MsgBox timer gives False and Form1 where MsgBox Timer gives a number value but I don't see
    Both forms are called with the same method (Form1.Show).

    Has someone already saw that problem ?

    Thanks
    Last edited by Couin; Dec 2nd, 2022 at 11:21 AM.
    1 Hour vinyl mix live on Eurodance90 each sunday 10:00 PM (French Timezone) - New non-official Jingle Palette update Jingle Palette Reloaded

  2. #2
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    5,872

    Re: MsgBos Timer on some Forms

    Do you have a control or variable named Timer in this form?

  3. #3

    Thread Starter
    Hyperactive Member Couin's Avatar
    Join Date
    Dec 2020
    Posts
    272

    Re: MsgBos Timer on some Forms

    Hi

    Even with no code (excepted for CommandButton_click) I get the problem. It drives me crazy
    1 Hour vinyl mix live on Eurodance90 each sunday 10:00 PM (French Timezone) - New non-official Jingle Palette update Jingle Palette Reloaded

  4. #4
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,143

    Re: MsgBos Timer on some Forms

    post all the code of your form that is giving you your issue
    Sam I am (as well as Confused at times).

  5. #5
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    5,872

    Re: MsgBos Timer on some Forms

    In the Immediate Window type:
    Code:
    ? TypeName(timer), timer
    Single         57174,84

  6. #6

    Thread Starter
    Hyperactive Member Couin's Avatar
    Join Date
    Dec 2020
    Posts
    272

    Re: MsgBox Timer on some Forms

    Quote Originally Posted by SamOscarBrown View Post
    post all the code of your form that is giving you your issue
    Hi, like I was saying to Arnoutdv, even without anycode on this form, the problem is here.

    @Arnoutdv : I get the same result The problem is that on some form, MsgBox Timer gives "False", and on others, it gives the timer value.

    I "resolved" the problem for this form, by copy/paste its controls (2 labels, one button) on the new "Form1" that has no problem, and delete the old form, rename the new. The problem gone. But I don't know what it was.

    I have to do the same with the form where I discovered the problem.

    Edit : Tryng to apply the workaround on another form where the is also the problem, the problem still there ...
    Last edited by Couin; Dec 2nd, 2022 at 11:21 AM.
    1 Hour vinyl mix live on Eurodance90 each sunday 10:00 PM (French Timezone) - New non-official Jingle Palette update Jingle Palette Reloaded

  7. #7
    PowerPoster
    Join Date
    Nov 2017
    Posts
    3,116

    Re: MsgBox Timer on some Forms

    Unless you do as people ask, no one can help you.

    Open the contents of the "broken" form's .frm file in Notepad to capture all the code and "behind the scenes" configuration, and post the contents here. Or, you can just search the .frm file from Notepad for "Timer", and you will almost certainly find the problem.

  8. #8
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    9,853

    Re: MsgBox Timer on some Forms

    Use VBA.Timer instead of just Timer, and I bet your problem is solved. Like others have said, you've got some other object (or function) named Timer.
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

  9. #9

    Thread Starter
    Hyperactive Member Couin's Avatar
    Join Date
    Dec 2020
    Posts
    272

    Re: MsgBox Timer on some Forms

    Hi,

    sorry, I misunderstood , I though that was the code in View Code (in VB6) that was requiered.
    Here is the content of frm file of a broken form :
    Code:
    VERSION 5.00
    Begin VB.Form FormHS 
       BorderStyle     =   1  'Fixed Single
       Caption         =   "FormHS"
       ClientHeight    =   9135
       ClientLeft      =   3420
       ClientTop       =   390
       ClientWidth     =   12345
       ClipControls    =   0   'False
       ControlBox      =   0   'False
       Icon            =   "FormHS.frx":0000
       KeyPreview      =   -1  'True
       LinkTopic       =   "Form2"
       MaxButton       =   0   'False
       MinButton       =   0   'False
       PaletteMode     =   1  'UseZOrder
       ScaleHeight     =   9135
       ScaleMode       =   0  'User
       ScaleWidth      =   12345
       StartUpPosition =   1  'CenterOwner
       Begin VB.CommandButton Command1 
          Caption         =   "Command1"
          Height          =   615
          Left            =   120
          TabIndex        =   0
          Top             =   120
          Width           =   615
       End
    End
    Attribute VB_Name = "FormHS"
    Attribute VB_GlobalNameSpace = False
    Attribute VB_Creatable = False
    Attribute VB_PredeclaredId = True
    Attribute VB_Exposed = False
    Private Sub Command1_Click()
    MsgBox Timer
    End Sub
    Hi Elroy

    I think there is another problem, it look there is no control named Timer here
    1 Hour vinyl mix live on Eurodance90 each sunday 10:00 PM (French Timezone) - New non-official Jingle Palette update Jingle Palette Reloaded

  10. #10
    PowerPoster
    Join Date
    Nov 2017
    Posts
    3,116

    Re: MsgBox Timer on some Forms

    Are there any modules that are part of this project? If so, do they have any items named "Timer"?

    Edit to also ask:

    On that broken form, if you start typing in the Code Window Timer. (Timer with a period after it), what, if anything, does intellisense show?

  11. #11

    Thread Starter
    Hyperactive Member Couin's Avatar
    Join Date
    Dec 2020
    Posts
    272

    Re: MsgBox Timer on some Forms

    Looks nothing found called "Timer" in the project.

    Sorry, I don't understand the "Code Window Timer. (Timer with a period after it)", what do you mean ?

    Thanks
    1 Hour vinyl mix live on Eurodance90 each sunday 10:00 PM (French Timezone) - New non-official Jingle Palette update Jingle Palette Reloaded

  12. #12
    Addicted Member Wolfgang Enzinger's Avatar
    Join Date
    Apr 2014
    Location
    Munich, Germany
    Posts
    160

    Re: MsgBox Timer on some Forms

    Quote Originally Posted by Couin View Post
    If I set a simple code :
    Code:
    Private Sub CommandButton_click()
    MsgBox Timer
    End Sub
    It displays "False" instead of a value if I do the same on main form or some other forms.
    Right-click on Timer in your code, then choose "Definition". Where does it jump to?

    Should be

    Property Timer As Single
    read-only
    Member of VBA.DateTime


    in the Object Browser - if Timer in your code really is what you think it is.

    Best regards,
    Wolfgang

  13. #13
    PowerPoster
    Join Date
    Nov 2017
    Posts
    3,116

    Re: MsgBox Timer on some Forms

    Quote Originally Posted by Couin View Post
    Looks nothing found called "Timer" in the project.

    Sorry, I don't understand the "Code Window Timer. (Timer with a period after it)", what do you mean ?

    Thanks
    In the code window, in your Command1_Click procedure, start a new line and type Timer. (Timer with a period after it) and see what, if anything, Intellisense displays in the completion window. That should shed light on what it thinks "Timer" "Is".

  14. #14
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    9,853

    Re: MsgBox Timer on some Forms

    Did you even try VBA.Timer? I'd love to know if you can still get the problem using VBA.Timer, as you didn't show us all possible functions and objects in this project. It doesn't have to be in the form with which you're working.
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

  15. #15

    Thread Starter
    Hyperactive Member Couin's Avatar
    Join Date
    Dec 2020
    Posts
    272

    Re: MsgBox Timer on some Forms

    Sorry Elroy, I missed to answer, but yes, with VBA.Timer it's ok.
    It doesn't explain why Timer is not always ok, but as default case, if I can not resolve, I will uese VBA.Timer

    Quote Originally Posted by Wolfgang Enzinger View Post
    Right-click on Timer in your code, then choose "Definition". Where does it jump to?

    Should be

    Property Timer As Single
    read-only
    Member of VBA.DateTime
    Hi, Yes, this is what I get

    Quote Originally Posted by OptionBase1 View Post
    In the code window, in your Command1_Click procedure, start a new line and type Timer. (Timer with a period after it) and see what, if anything, Intellisense displays in the completion window. That should shed light on what it thinks "Timer" "Is".
    I tried, I get nothing displayed more than what I type, no suggestion.



    1 Hour vinyl mix live on Eurodance90 each sunday 10:00 PM (French Timezone) - New non-official Jingle Palette update Jingle Palette Reloaded

  16. #16

  17. #17

    Thread Starter
    Hyperactive Member Couin's Avatar
    Join Date
    Dec 2020
    Posts
    272

    Re: MsgBox Timer on some Forms

    Hi Eduardo

    This is what I get, but without "Timer" timer

    Also, I finally get to rid off the problem by recreating new forms and transfering elements from olds to news.

    At least, I can now go ahead, even if it rests as mystery lol
    1 Hour vinyl mix live on Eurodance90 each sunday 10:00 PM (French Timezone) - New non-official Jingle Palette update Jingle Palette Reloaded

  18. #18
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,995

    Re: MsgBox Timer on some Forms

    Quote Originally Posted by Couin View Post
    Hi Eduardo

    This is what I get, but without "Timer" timer

    Also, I finally get to rid off the problem by recreating new forms and transfering elements from olds to news.

    At least, I can now go ahead, even if it rests as mystery lol
    I bet you that there is/was a Timer control there that you didn't see.

  19. #19

  20. #20
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,531

    Re: MsgBox Timer on some Forms

    Quote Originally Posted by Eduardo- View Post
    I bet you that there is/was a Timer control there that you didn't see.
    there was ...
    Code:
       Begin VB.Timer Timer 
          Enabled         =   0   'False
          Left            =   480
          Top             =   1800
       End
    A timer named Timer ... looks like it was hiding behind the button....

    Code:
       Begin VB.CommandButton Command1 
          Caption         =   "Command1"
          Height          =   612
          Left            =   1080
          TabIndex        =   0
          Top             =   1320
          Width           =   2892
       End
    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  21. #21
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,995

    Re: MsgBox Timer on some Forms

    Quote Originally Posted by techgnome View Post
    there was ...
    Code:
       Begin VB.Timer Timer 
          Enabled         =   0   'False
          Left            =   480
          Top             =   1800
       End
    A timer named Timer ... looks like it was hiding behind the button....

    Code:
       Begin VB.CommandButton Command1 
          Caption         =   "Command1"
          Height          =   612
          Left            =   1080
          TabIndex        =   0
          Top             =   1320
          Width           =   2892
       End
    -tg
    In the download you made it was totally visible.

  22. #22
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,531

    Re: MsgBox Timer on some Forms

    Was it? I jsut opened the frm file ... don't have Vb6 installed...


    yeah, then I don't have an idea what's going on.


    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  23. #23
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,995

    Re: MsgBox Timer on some Forms

    Quote Originally Posted by techgnome View Post
    Was it? I jsut opened the frm file ... don't have Vb6 installed...


    yeah, then I don't have an idea what's going on.


    -tg
    Name:  Sin título.png
Views: 416
Size:  4.4 KB

  24. #24
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,531

    Re: MsgBox Timer on some Forms

    Jeezes... Immma dork... I thought I was downloading the OP's project... I wan't paying close enough attention and didn't realize it was your project. Thank god it's friday and the weekend is here....



    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  25. #25
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,143

    Re: MsgBox Timer on some Forms

    Thank god it's friday and the weekend is here....(tg)

    Hee-hee Ain't that the truth...woke up this morning and my iphone was DEAD (new iPhone 14 Plus bought in October). Luckily, a chat agent was able to described a 'soft-reboot' procedure. I followed those instructions and it is working fine now. The point is, as mentioned above by OptionBase (Post #7), please follow instructions --- will help the rest of us in the future assist in solving your problem (this is not just advice for the OP, but for anyone else who posts issues in this forum.)

    PS--that quote should be capitalized God and Friday! :-)

    Sam
    Sam I am (as well as Confused at times).

  26. #26
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: MsgBox Timer on some Forms

    Quote Originally Posted by techgnome View Post
    Jeezes... Immma dork... I thought I was downloading the OP's project... I wan't paying close enough attention and didn't realize it was your project. Thank god it's friday and the weekend is here....



    -tg
    Don't feel bad I almost did the same thing, got so far as to start typing a response when I realized it wasn't the OPs project.

  27. #27

    Thread Starter
    Hyperactive Member Couin's Avatar
    Join Date
    Dec 2020
    Posts
    272

    Re: MsgBox Timer on some Forms

    Quote Originally Posted by Eduardo- View Post
    I bet you that there is/was a Timer control there that you didn't see.
    Hi Eduardo,

    I had checked in the list of controls in the Properties area, but there was no "Timer".
    This mystery will be archived in black hole lol

    See ya
    1 Hour vinyl mix live on Eurodance90 each sunday 10:00 PM (French Timezone) - New non-official Jingle Palette update Jingle Palette Reloaded

  28. #28
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: [RESOLVED] MsgBox Timer on some Forms

    You should have uploaded the project where you have this issue. Could have probably saved a bunch of posts.

    You said that you had tried typing in Timer and a . after wards which would indicate there was not a control by that name but there could be a variable by that name and you would get nothing after you type the dot. The only way to know is to upload a project that shows the issue and let someone have a look at it. It is likely an easy fix.

  29. #29
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,995

    Re: MsgBox Timer on some Forms

    Quote Originally Posted by Couin View Post
    Hi Eduardo,

    I had checked in the list of controls in the Properties area, but there was no "Timer".
    This mystery will be archived in black hole lol

    See ya
    As DataMiser says, if you upload the form there will be no mystery.

  30. #30

    Thread Starter
    Hyperactive Member Couin's Avatar
    Join Date
    Dec 2020
    Posts
    272

    Re: [RESOLVED] MsgBox Timer on some Forms

    Hi Eduardo,

    I thought that posting the Form.frm file content in my previous post would be enough to check the form.

    I join here the FormHS.frm here

    FormHS.frm

    I would be very surprise if someone here fing a "Timer" in it, as well as I opened if on another machine with VB6.

    Thanks
    1 Hour vinyl mix live on Eurodance90 each sunday 10:00 PM (French Timezone) - New non-official Jingle Palette update Jingle Palette Reloaded

  31. #31
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: [RESOLVED] MsgBox Timer on some Forms

    Don't see any issue with the form you uploaded, msgbox displays the numeric value one would expect.

    If you open that form directly all by itself do you see the issue where the msgbox says false?

    If not but you do when you open the project with the form in it then the problem is not in the form could be a module, a reference these would not show up in just a form file. would need to see the actual project where the problem appears. If you have a module as part of the project the problem could be there.
    Last edited by DataMiser; Dec 9th, 2022 at 12:11 AM.

  32. #32
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,995

    Re: [RESOLVED] MsgBox Timer on some Forms

    Quote Originally Posted by Couin View Post
    Hi Eduardo,

    I thought that posting the Form.frm file content in my previous post would be enough to check the form.

    I join here the FormHS.frm here

    FormHS.frm

    I would be very surprise if someone here fing a "Timer" in it, as well as I opened if on another machine with VB6.

    Thanks
    The next time upload the exact project with the exact form for us to see it and experience the same issue as you allegedly do, and preferably do it in the first post when you ask the question and ask for help.

    It seems that the original form with the issue does not exist anymore now, and if it does, post it, because the form that you posted is not having the issue that you described.

  33. #33

    Thread Starter
    Hyperactive Member Couin's Avatar
    Join Date
    Dec 2020
    Posts
    272

    Re: [RESOLVED] MsgBox Timer on some Forms

    Hi Eduardo and DataMiser,

    That's why it's a mistery because I have the problem with this form and there is not timer inside it and nothing in the project has any reference to a timer in this form

    In all case, since I re-created new forms to replace bad ones, I have no longer the problem

    1 Hour vinyl mix live on Eurodance90 each sunday 10:00 PM (French Timezone) - New non-official Jingle Palette update Jingle Palette Reloaded

  34. #34
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: [RESOLVED] MsgBox Timer on some Forms

    Quote Originally Posted by Couin View Post
    Hi Eduardo and DataMiser,

    That's why it's a mistery because I have the problem with this form and there is not timer inside it and nothing in the project has any reference to a timer in this form

    In all case, since I re-created new forms to replace bad ones, I have no longer the problem

    But you say there is nothing in the project that is a problem, maybe there is you did not upload the project just the form and there is nothing wrong with the form. If you were to just load the form, not the project and run it then you would likely not see any issue either which would mean the issue is else where. If you do then that would indicate that there is a problem with your VB installation.

    The important thing to remember is that if you want to get to the bottom of an error you have to make sure that what you post actual shows the error other wise no one can do anything more than guess. The form you posted does not show the error so not much can be done.

  35. #35

    Thread Starter
    Hyperactive Member Couin's Avatar
    Join Date
    Dec 2020
    Posts
    272

    Re: [RESOLVED] MsgBox Timer on some Forms

    I was meaning that in the project, there was nothing called "Timer" as control or programmaticaly create control.
    Also, for some reasons, I can not share the whole project.
    Probably a bug somewhere, because here is what I did :
    Renamed the frame where the problem appears, to "FormHS".
    Created a new frame named with the original name of the previous form (so if something in the project was creating a "Timer" on the old form, it should create as well on the new form, as well as the form name is the same).

    I keep the thread bookmarked, if it happens on another project, I will comeback to post

    Have a nice day
    1 Hour vinyl mix live on Eurodance90 each sunday 10:00 PM (French Timezone) - New non-official Jingle Palette update Jingle Palette Reloaded

  36. #36
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: [RESOLVED] MsgBox Timer on some Forms

    Did you ever try loading that form directly by itself and see if you get the same results?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width