Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

Countdown to SUMMERHELP =)


  • Please log in to reply

#1
sumguy

sumguy

    Member

  • Member
  • PipPip
  • 54 posts
Hello all, i wanted to create a program that will give me the number of days in between, "Current Date" and the date of June 11th... So this way i will know the days remaining until summer =)

1. This is not a HOMEWORK assignment. It is for my own pleasure.
2. I have posted another topic on this, but no one helped out too much =(
3. Metallica helped me with some links, they were for "time" countdown, not "day"
4. Another person helped and i got this..

I used to get an error saying, " False days left of school", then i changed boolean to True, and now I'm stuck.

[codebox]
Private Sub Command1_Click()
Dim strMsg As String
strMsg = intDaysRemaining = Day(dateVariable - Now, True)
strMsg = strMsg & "days left of school"
Text1.Text = strMsg
End Sub

Now it gives me the error on the word "Day" saying wrong number of arguments, or invalid property.
[/codebox]
  • 0

Advertisements


#2
Ax238

Ax238

    Tech Staff

  • Technician
  • 1,323 posts
Hello sumguy,

The problem you are having is in the following statement:
strMsg = intDaysRemaining = Day(dateVariable - Now, True)
One problem is that you are setting strMsg to the result of the boolean expression "intDaysRemaining = Day(dateVariable - Now, True)". Of course they are not equal, so it would put False in for strMsg. The second problem is that the Day function can only take one parameter and you are using two.

You can try the following instead:
strMsg = DateDiff("d", Now, dateVariable) & " days left of school"

Regards,

Ax
  • 0

#3
sumguy

sumguy

    Member

  • Topic Starter
  • Member
  • PipPip
  • 54 posts
Thank you for the reply, worked out perfect, =) :)
  • 0

#4
Ax238

Ax238

    Tech Staff

  • Technician
  • 1,323 posts
:) Glad to hear it! You're welcome.
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP