Solved

Do Loop Until  problem (Won't Stop)

Posted on 2004-04-28
2
290 Views
Last Modified: 2011-10-03
Hi
I have a problem

Question 1

My loop won't stoppp

Dim startTime As Date
Dim endTime As Date
startTime = "9:30:00"
endTime = "18:00:00"

Do
blah
blah
startTime = startTime + "0:10:00"
Loop Until (startTime = endTime)

It won't stop?

Question 2

minute2 = DatePart("n", startTime)

If minute2 = 20 Or 50 Then
blah
blah
else
blah
blah
End If

The above works if the if statement is only looking for 20 . After I put the Or in it it  just keep staying on the top and won't go to else.
Any idea why?

Thanks

Please help
0
Comment
Question by:EuropePT
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 5

Accepted Solution

by:
bwdowhan earned 125 total points
ID: 10944704
What if you change the (startTime = endTime) to (startTime >= endTime)..

on the minute2 questions: If ((minute2 = 20) or (minute2 = 50)) Then

~Brian
0
 

Author Comment

by:EuropePT
ID: 10944766
Great Thanks!! Both Works!
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Read about achieving the basic levels of HRIS security in the workplace.
This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question