473,585 Members | 2,467 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

LOOP Testing (True of False)

72 New Member
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.backcol or = vbred
txtSubjects.bac kcolor = vbred
MsgBox ("there's an error!"),vbCrit ical

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 1174
Killer42
8,435 Recognized Expert Expert
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
4665
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. Something like... <Script Language="JavaScript"> <!-- function playSound(soundName, loops, timeLength){
10
2100
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 part I don't know commands .... ..... ..... Loop
5
2725
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 puck moving around. I want the puck is bounce when it hits a border (specified by the hitlines). Retreieved some info on hit testing lines from Bob...
10
4560
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 and unsafe pointers to iterate over an image's pixels. The inner-loop looked like this: for (int x = 0; x < _buffer.Width*_buffer.Height; x++) {...
38
2017
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
2217
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 complete and "other times" I get incomplete stdout. E.g: - on boxA ffmpeg returns in ~25s; on boxB (comparable hardware,
73
4578
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 endless loop in a line with: if a==b: print 'OK' I mean, it would be of much help to me on my way to understanding Python to know how such prefix...
2
2343
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 when the date (or xDate) goes over to the next month, dlookup returns NULL even though though there is a record. For example if CALWEEKSTART is...
3
2493
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. I have it set in a way whenever I click the PLAY button, the PLAY button is suppose to hide and the PAUSE button is suppose to appear. This does not...
15
2004
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 action="javascript:;" id="form1">
0
7908
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8199
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8336
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7950
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8212
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5710
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5389
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3835
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1447
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.