Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
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