473,800 Members | 2,385 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

need help to simply my code (LOOPING STATEMENT)

72 New Member
Hi vb master i need help on this

here my code:
Expand|Select|Wrap|Line Numbers
  1. If Combo1(0) = rs.Fields("TimeStart") And Combo4(0) = rs.Fields("TimeEnd") And Combo2(0) = rs.Fields("ROOM") And Combo3(0) = rs.Fields("DAYS") Then
  2.                 cmdSave.Enabled = False
  3.                 MsgBox ("There's a conflict on this!"), vbCritical
  4.  
  5.            Else
  6.  
  7.            If Combo1(1) = rs.Fields("TimeStart") And Combo4(1) = rs.Fields("TimeEnd") And Combo2(1) = rs.Fields("ROOM") And Combo3(1) = rs.Fields("DAYS") Then
  8.                 cmdSave.Enabled = False
  9.                 MsgBox ("There's a conflict on this!"), vbCritical
  10.            Else
  11.  
  12.            If Combo1(2) = rs.Fields("TimeStart") And Combo4(2) = rs.Fields("TimeEnd") And Combo2(2) = rs.Fields("ROOM") And Combo3(2) = rs.Fields("DAYS") Then
  13.                 cmdSave.Enabled = False
  14.                 MsgBox ("There's a conflict on this!"), vbCritical
  15.            Else
  16.  
  17.            If Combo1(3) = rs.Fields("TimeStart") And Combo4(3) = rs.Fields("TimeEnd") And Combo2(3) = rs.Fields("ROOM") And Combo3(3) = rs.Fields("DAYS") Then
  18.                 cmdSave.Enabled = False
  19.                 MsgBox ("There's a conflict on this!"), vbCritical
  20.            Else
  21.  
  22.                 MsgBox (" Good "), vbOKOnly
  23.  
  24.             End If
  25.             End If
  26.             End If
  27.             End If
  28.  
i need to simplify this code of mine to make it short! i need to code it in a looping statement

I hope you can help me with this.. thank you very much...
Jun 1 '07 #1
1 1188
Killer42
8,435 Recognized Expert Expert
See my post in your other thread.
Jun 1 '07 #2

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

Similar topics

8
1697
by: Drew | last post by:
I am trying to build a small app that shows a Course Title from the database, then displays a dropdown full of categories for the user to choose one... I thought a loop would be the best way to accomplish this, but since the dropdown is dynamic, I am having problems. Can someone help me out here? Here is my code, For i = 1 to Num
4
2567
by: Sjoerd | last post by:
Summary: Use foreach(..) instead of while(list(..)=each(..)). --==-- Foreach is a language construct, meant for looping through arrays. There are two syntaxes; the second is a minor but useful extension of the first: foreach (array_expression as $value) statement
2
4726
by: clinttoris | last post by:
Hello, If someone could help me it would be appreciated as I am not having much luck. I'm struggling with my asp code and have some questions relating to asp and oracle database. First question. I have a web survey that I am working on and have successfully dynamically taken the info from a database, displayed it on the screen and then taken the users answers and inserted them into a
9
2199
by: MrHelpMe | last post by:
Hello again experts, I have successfully pulled data from an LDAP server and now what I want to do is drop the data into a database table. The following is my code that will insert the data but that has problems. FullName=Request.Form("Name") Email=Request.Form("Email") GivenName=Request.Form("GivenName")
6
2138
by: Twobridge | last post by:
I hope someone can help me out with my problem. I have found a sql statement that basically pulls all bills filed within a certain time period and the payments made on those bills with in the same time period. I group the payments by payment year and filed year which gives me a matrix with the filed year as the row and the pay year as the column....and this appears fine. My problem is that my employer does not want to see the...
1
1939
by: bitong | last post by:
Here's the problem.. Write a program that will add up all the 10 consecutive integers using for statement. Example: 1+2+3+4+5+6+7+8+9+10=55.. output program will be: sum=55. can't figure it out...i'm just a newbie in c++. #include <iostream.h> main() { int x, sum; for(x=1;x<=10;x++)
8
2259
by: jasson118 | last post by:
calculate the power of 2 integers. For example, power(2,3)=8, power(3,2)=9,power(4,0)=1. Not allow use power math function.Two integers are read from input by scanf. The program must produce an error message when the user enter a negative number, able to calculate the powers until terminate by user "by entering ctl-Z". output show both input integer and the result. program 1 use "while" statement to do the calculation.program 2 use...
9
1915
by: TF | last post by:
Hello all, I made a ASP.NET 2.0 site that shows possible "recipes" for paint colors stored in an access dbase. Basically, 1000 colors are stored with specific RGB values in separate columns. A user sees all the colors listed on the page with hyperlinks that open the "mixes" page. The mixes page goes through each record, compares it with all other records in a ratio up to "maxratio". If it finds a ratio that matches the redvalue of...
0
9551
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10505
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10275
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10253
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
10033
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9085
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5471
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4149
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.