Solved

Do Loop Until  problem (Won't Stop)

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

SQL Command Tool comes with APEX under SQL Workshop. It helps us to make changes on the database directly using a graphical user interface. This helps us writing any SQL/ PLSQL queries and execute it on the database and we can create any database ob…
I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
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…

746 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now