3 Replies - 446 Views - Last Post: 07 April 2013 - 07:09 AM Rate Topic: -----

#1 mani9597  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 19-July 12

do loop inside the if elseif condition elseif not working?

Posted 06 April 2013 - 12:53 AM

Do
If employee.Fields("QTYORDERED").Value = 0 Then
employee.Delete
ElseIf employee.Fields("QTYORDERED").Value > 0 Then
item = True
End If
Loop While .GoNext


else if part not working
Is This A Good Question/Topic? 0
  • +

Replies To: do loop inside the if elseif condition elseif not working?

#2 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 300
  • View blog
  • Posts: 1,776
  • Joined: 26-March 09

Re: do loop inside the if elseif condition elseif not working?

Posted 06 April 2013 - 01:45 AM

View Postmani9597, on 06 April 2013 - 07:53 AM, said:

Do
If employee.Fields("QTYORDERED").Value = 0 Then
employee.Delete
ElseIf employee.Fields("QTYORDERED").Value > 0 Then
item = True
End If
Loop While .GoNext


else if part not working


When you say it's not working, what are you expecting it to do other than set a variable?

Have you put a stepped it through in debug mode?
Was This Post Helpful? 0
  • +
  • -

#3 BobRodes  Icon User is offline

  • Your Friendly Local Curmudgeon
  • member icon

Reputation: 574
  • View blog
  • Posts: 2,989
  • Joined: 19-May 09

Re: do loop inside the if elseif condition elseif not working?

Posted 06 April 2013 - 10:19 AM

The words "not working" and "doesn't work" need to be permanently excised from the dreamincode lexicon. :)
Was This Post Helpful? 0
  • +
  • -

#4 Neku  Icon User is offline

  • D.I.C Regular

Reputation: 20
  • View blog
  • Posts: 268
  • Joined: 21-May 09

Re: do loop inside the if elseif condition elseif not working?

Posted 07 April 2013 - 07:09 AM

the if conditions are inside the loop and you did not take into account the possibility that the value will be less than 0 thus both conditions are false and therefore are not executed
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1