By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,538 Members | 958 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,538 IT Pros & Developers. It's quick & easy.

need help to simply my code (LOOPING STATEMENT)

P: 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
Share this Question
Share on Google+
1 Reply


Expert 5K+
P: 8,434
See my post in your other thread.
Jun 1 '07 #2

Post your reply

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