Hi, I am pretty new to Visual Basic 6 and I'm having a problem with a small program I'm writting for fun.

Now when I do the following:

If ClockTime = #6:52:50 PM# Then

The whole code works 100% find and dectect that the time has hit that time. Which is almost good but I want to be able to change the time. So I tried a string and I did the following:

Dim STime as String
STime = "#6:57:00 PM#"

And then Reorganized my code to test to:

If ClockTime = STime Then

And It refused to work when It reached the time.

Could someone tell me what I'm doing wrong and show me the right way and then Explain to me why.

Recommended Answers

All 2 Replies

Where does the variable "ClockTime" get it's data from?

I have clocktime right now set up like this:

ClockTime = Format(Time, "Long Time")
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.