Solved

Do Loop Until  problem (Won't Stop)

Posted on 2004-04-28
2
289 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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
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…

726 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