473,386 Members | 1,745 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,386 software developers and data experts.

need help to simply my code (LOOPING STATEMENT)

72
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 1172
Killer42
8,435 Expert 8TB
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
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...
4
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...
2
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...
9
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...
6
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...
1
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...
8
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...
9
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...
0
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...

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.