Results 1 to 16 of 16

Thread: [RESOLVED] I dont know why my form doesnt show anything, even though it compiles

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2006
    Posts
    79

    Resolved [RESOLVED] I dont know why my form doesnt show anything, even though it compiles

    I attached my project files, i would be very grateful if anyone could help me check /correct why the form just shows without any values. Thanks in advance
    Attached Files Attached Files

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: I dont know why my form doesnt show anything, even though it compiles

    Thats because you have "Class_Initialize" instead of Form_Load.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Mar 2006
    Posts
    79

    Re: I dont know why my form doesnt show anything, even though it compiles

    Quote Originally Posted by RobDog888
    Thats because you have "Class_Initialize" instead of Form_Load.
    Ok I tried it like this:
    VB Code:
    1. Private Sub Form_Load()
    2.    dayStart = #7:00:00 AM#
    3.    dayEnd = #5:00:00 PM#
    4.    StartTime = #7:00:00 AM#
    5.    EndTime = #5:00:00 PM#
    6.    locHolidays = ""
    7.    Call TimeDifference
    8. End Sub

    now it compiles without displaying the form at all, what should i do now? Could you fix and re-attach and zip it here for me to downlaod? Thanks
    Last edited by okaka; Dec 2nd, 2006 at 02:16 PM.

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: I dont know why my form doesnt show anything, even though it compiles

    Is your startup object Form1?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Mar 2006
    Posts
    79

    Re: I dont know why my form doesnt show anything, even though it compiles

    Quote Originally Posted by RobDog888
    Is your startup object Form1?
    I dont understand what you meant by form1. I know that in order to display the form has to load, that i did. I have just one form, no instances, but have lbl and txt controls

  6. #6
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: I dont know why my form doesnt show anything, even though it compiles

    If you go to Project|Project1 Properties you'll see what Rob is talking about. However you should be OK. I downloaded your zip file from post #1 and when I extracted the files and ran the app your form showed up just fine.

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Mar 2006
    Posts
    79

    Re: I dont know why my form doesnt show anything, even though it compiles

    Quote Originally Posted by MartinLiss
    If you go to Project|Project1 Properties you'll see what Rob is talking about. However you should be OK. I downloaded your zip file from post #1 and when I extracted the files and ran the app your form showed up just fine.
    Did it show with values on the txtboxes, cos mine showed without any values?

  8. #8
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: I dont know why my form doesnt show anything, even though it compiles

    Oh, I think I see what your talking about. You are wondering why the fields on the form are blank. The reason for that is that you are not putting anything into them. For example you should do something like

    txtStartTime(0) = StartTime

    at the end of your QC Sub.

    Also I don't know where you got your code from but it looks like some of it doesn't belong. Rob pointed out Class_Initialize and there is also Sub Main which is something that is normally in a code module and not a Form module.

  9. #9

    Thread Starter
    Lively Member
    Join Date
    Mar 2006
    Posts
    79

    Re: I dont know why my form doesnt show anything, even though it compiles

    "Must have a start up form or Sub Main()"...thats the error i got when i changed the project type to Standard Exe. Then when changed to ActiveX DLL, the compiler said:"No Public user control detected, press F1 for more info"...i dont understand whats going on here.
    is it because i used class's (Public Property Get and Let subroutines)?

  10. #10
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: I dont know why my form doesnt show anything, even though it compiles

    Quote Originally Posted by okaka
    "Must have a start up form or Sub Main()"...thats the error i got when i changed the project type to Standard Exe. Then when changed to ActiveX DLL, the compiler said:"No Public user control detected, press F1 for more info"...i dont understand whats going on here.
    is it because i used class's (Public Property Get and Let subroutines)?
    What type of project do you want? If you want a standalone application (which is what you have now) then leave it as it is. Look for the topic called Choosing a Project Type and Setting Project Properties in help for an explanation.

  11. #11

    Thread Starter
    Lively Member
    Join Date
    Mar 2006
    Posts
    79

    Re: I dont know why my form doesnt show anything, even though it compiles

    Quote Originally Posted by MartinLiss
    Oh, I think I see what your talking about. You are wondering why the fields on the form are blank. The reason for that is that you are not putting anything into them. For example you should do something like

    txtStartTime(0) = StartTime

    at the end of your QC Sub.

    Also I don't know where you got your code from but it looks like some of it doesn't belong. Rob pointed out Class_Initialize and there is also Sub Main which is something that is normally in a code module and not a Form module.
    Ok i have been trying to get this to work,thats why i added the Sub Main, cos of the error message. I even added what you asked me to, but still no changes
    could you help me debug it and post it as zip in its working state cos i have exhausted all i knew at the moment?

  12. #12
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: I dont know why my form doesnt show anything, even though it compiles

    Quote Originally Posted by okaka
    Ok i have been trying to get this to work,thats why i added the Sub Main, cos of the error message. I even added what you asked me to, but still no changes
    could you help me debug it and post it as zip in its working state cos i have exhausted all i knew at the moment?
    Okay I don't know what you want the goal of your project is so this is as much as I can do. Look for 'new for my changes.
    Attached Files Attached Files

  13. #13

    Thread Starter
    Lively Member
    Join Date
    Mar 2006
    Posts
    79

    Re: I dont know why my form doesnt show anything, even though it compiles

    Quote Originally Posted by MartinLiss
    Okay I don't know what you want the goal of your project is so this is as much as I can do. Look for 'new for my changes.
    Thanks a bunch it works like magic, but only starttime has value others are blank...I have to figure out how to resolve that...i really appreciate it, 5 stars for you

  14. #14
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: I dont know why my form doesnt show anything, even though it compiles

    Its part of this thread/project Martin: http://vbforums.com/showthread.php?t=440859

    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  15. #15
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: I dont know why my form doesnt show anything, even though it compiles

    Now that we've helped you, you can help us by pulling down the Thread Tools menu and clicking the Mark Thread Resolved button which will let everyone know that you have your answer.

  16. #16

    Thread Starter
    Lively Member
    Join Date
    Mar 2006
    Posts
    79

    Re: I dont know why my form doesnt show anything, even though it compiles

    Quote Originally Posted by MartinLiss
    Now that we've helped you, you can help us by pulling down the Thread Tools menu and clicking the Mark Thread Resolved button which will let everyone know that you have your answer.
    right away sir

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