473,326 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

LOOP Testing (True of False)

72
Hi there i have a problem with the looping statement that i must use in order to achieve wha i want..

Its like this i have a time scheduling system that compares records in a database the compare process is not a problem.

if like this, what ive been compare is this:

if combo1(x) = rs! "TimeStart and combo2(x) = rs!TimeEnd then

txtCode.backcolor = vbred
txtSubjects.backcolor = vbred
MsgBox ("there's an error!"),vbCritical

end if


where: "x" is my counter dis is the code for my counter

for x = 0 to 15


Now, what i want to do is, to test first all the combo boxes that i have, before prompting the user the that schedule been made has an error on the previous records that are being save in my database.. and then highlight the schedule that has errors on it.

Dont bother about the connection in my database, it is settle now, just concentrate on the loop... i dont have an idea on how to code those scenarios tat i want to do, whenever there an equal value on the database that i have.

to summarized here what i want to do:

1. test if theres an equal value of the combo boxes in my database(i know how to compare it, theres no problem in this area).

2. after testing all the values, if theres an equal value, prompt the user that theres an error.

3. highlight all the combo boxes that have errors.

i hope you do understand what am trying to say...

Thank you very much. any idea will help me to do this.
Jun 1 '07 #1
1 1168
Killer42
8,435 Expert 8TB
Here's some logic that might work (it's written in a sort of VB-inspired pseudo-code)...
Expand|Select|Wrap|Line Numbers
  1. Clear error flag
  2. For x = 0 To 15
  3.   If combo(x) = rs(FieldName(x)) Then
  4.     combo(x).BackColor = vbRed
  5.     Set error flag
  6.   Else
  7.     combo(x).BackColor = vbWhite
  8.   End If
  9. Next
  10. If error flag is set Then
  11.   MsgBox "Oops!"
  12.   Exit Sub
  13. End If
  14. Now go ahead - everything tested OK.
Jun 1 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Knocked Wood | last post by:
Hi, I looked around and can't find anything on this at all and can not get it to work for IE. I'm trying to loop multiple sounds on a game, with three unique variables, when a link is clicked....
10
by: Ronny Sigo | last post by:
Hello all, Could anybody give me the correct syntax for defining a loop using the form's recordset for as long as it is not at the end of the table ? example: Do While not EOF ' this is the...
5
by: Brian | last post by:
Hello all.. Am working on an Air Hockey game... have an table loaded into a picture box. The borders of the table are slightly slanted. Am using hit testing lines with GDI+ to manipulate the...
10
by: MariusI | last post by:
I stumbled over an optimization (or lack of one, to be specific) when viewing IL opcodes generated by the compiler using ms .net 2003. I was testing fast pixel manipulation using Bitmap.LockBits...
38
by: yomgui | last post by:
hello, is it legal to return inside a for loop or am I obliged to break out of the loop before returning ? thanks yomgui
1
by: Christopher DeMarco | last post by:
Hi all... I've written a class to provide an interface to popen; I've included the actual select() loop below. I'm finding that "sometimes" popen'd processes take "a really long time" to...
73
by: Claudio Grondi | last post by:
In the process of learning about some deeper details of Python I am curious if it is possible to write a 'prefix' code assigning to a and b something special, so, that Python gets trapped in an...
2
by: boyleyc | last post by:
Hi all the following code works perfectly well. Basically it populates a series of check boxes on my form, depending on whether dlookup finds an associated record. The problem i have is that...
3
by: bmerlover | last post by:
I believe my problem lies inside the while loop. When I click the play button on the gui app, it goes inside the while loop, reads the file and calls the necessary function to do what it needs to do....
15
by: dhtml | last post by:
Title says it. If I use a for in loop on an HTML collection, I get length twice. <!DOCTYPE HTML> <html lang="en"> <head> <title>length twice</title> </head> <body> <form...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.