What we're doing!
Basically we'll be making a program that calculates the date difference between the two dates specified!
GUI (LAYOUT):
This is my GUI:

----------------------------------------------------------------
What you need~
1 Command Button with:
Name: cmdCalc
Caption: Calculate!
1 ListBox with:
Name: lstAnswer
----------------------------------------------------------------
CODE (Very short & simple!)
Add this code into General Declarations before you begin adding the rest of the code:
Quote
Private Mint As Integer
Then add this code:
Quote
Private Sub cmdCalc_Click()
Mint = DateDiff("d", "5/09/2007", "11/09/2007")
lstAnswer.AddItem "The day difference = " & Mint
End Sub
Mint = DateDiff("d", "5/09/2007", "11/09/2007")
lstAnswer.AddItem "The day difference = " & Mint
End Sub
Code Explanation:
Quote
Private Sub cmdCalc_Click()
----------------------------------------------------------------
Quote
Mint = DateDiff("d", "5/09/2007", "11/09/2007")
----------------------------------------------------------------
Quote
lstAnswer.AddItem "The day difference = " & Mint
----------------------------------------------------------------
You can also change this:
Quote
Mint = DateDiff("d", "5/09/2007", "11/09/2007")
Year(s): "yyyy"
Month(s): "m"
Week(s): "ww"
Day(s): "d"
Hour(s): "h"
Minute(s): "n"
Second(s): "s"
Just replace the "d" with one of those and you're done!
ALSO you can obviously change the dates to whatever you want!
Thanks to Tcm9669 for the Screenshot program.
Thanks to TheComputerMaster for the upgraded Screenshot program.
Thanks to you for reading this tutorial!
Made by me, Travy92.
Lol, Samples!:


Sign In
Create Account




Back to top









