How to test whether date is today

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lee123
    Contributor
    • Feb 2007
    • 556

    #16
    hey thanks daniel it worked are again thanks to all of you other ones that help out too.


    lee123

    Comment

    • lee123
      Contributor
      • Feb 2007
      • 556

      #17
      Hey there is there a way to make this form pop up when starting up windows i mean if you have a date and time and a reminder in the textboxes that aren't due for a few days?

      lee123

      Comment

      • daniel aristidou
        Contributor
        • Aug 2007
        • 494

        #18
        Originally posted by lee123
        Hey there is there a way to make this form pop up when starting up windows i mean if you have a date and time and a reminder in the textboxes that aren't due for a few days?

        lee123
        Although there are many ways, and most will tell you to use the windows registry. I advise you to use the windows startup folder since it offers more control.

        Since i dont know what kind of program this is it varies on the way i would go about this.

        If you want the program to load every time the computer starts up- simply create a shortcut in the windows startup folder(should be located inside the startmenu)
        If not i might suggest that you place code inside you form which is something like this when the form loads.
        Code:
        if not textboxdate = Date then
        unload me
        End if
        There is another way i can think of but rather complicated.... ..let me know if this is what you want. if it isnt ill post the other method using the startup folder.

        Using the registry would make things alot more complicated.
        Another method occured to me using system service but coding it is beyond me. so i would will post the idea for someoneelse to help figure out if it comes to that. :-)
        (+_+)
        Regards Daniel

        Comment

        • lee123
          Contributor
          • Feb 2007
          • 556

          #19
          well the application i have made is a reminder. lets say you wanted a reminder of a certain date you had to do something then you would enter in the date and time and then when that date and time came the reminder program would pop up but right now it only works if you run the program and go to the (reminder) i have a database in the background saving the time and date in the database so it doesn't erase when you stop the program. if i was to distribute this program to someone else or they bought this from me and they liked the program they would probably want the form to load when they started windows. i mean if they had a date and time already in it.you know? and not have to run the program.( oh just so you know this form, is part of another form i created) but whats the use of this form if you had to run the program evertime. i didn't think this would be so useful especially if you had a million things to do. but it goes with the other forms.

          lee123

          Comment

          • daniel aristidou
            Contributor
            • Aug 2007
            • 494

            #20
            Originally posted by lee123
            lets say you wanted a reminder of a certain date you had to do something then you would enter in the date and time and then when that date and time came the reminder program would pop up but right now it only works if you run the program and go to the (reminder) i have a database in the background saving the time and date in the database so it doesn't erase when you stop the program. if i was to distribute this program to someone else or they bought this from me and they liked the program they would probably want the form to load when they started windows. i mean if they had a date and time already in it.you know? and not have to run the program.( oh just so you know this form, is part of another form i created) lee123
            OK ...
            2 options either a service. or your program will load with no forms visible on windows startup.
            The idea is for windows to load and then if the date and time is passed the form to appear.......Co rrect? Changing it into a service is beyond me...so im sure someone else can help out if thisdoes not work.I believe this way will work though.(~_~)
            This is what you do. you copy the program to startup folder.
            In vb you add this on the forms for when they load
            Code:
            private sub Form_Load
            Form.visible = False
            End sub
            However i suggest that you change the code you had previously so that instead of :
            Code:
            If XXXX=XXXXX then
            You changed it to
            Code:
            If format(now,"yyyymmddhhMM") >= format(XXXXX,"yyyymmddhhMM") then
            <Your form>.Show (1)
            This will have to be done due to the fact that you maystartup you computer after the date has passed.
            I can see a bug in this though. Question do you have a command button on the message form which shuts the program?
            If not i suggest you do.This will stop the message form being made modal over and over again.
            Daniel (~_~) Happy new year

            Comment

            Working...