Hello,
I have a form where there is three fields:
1) Combo376 (Combo box) = Value list "US" or "WW"
2) Text358 (Text box) = User need to enter number of locations (any numeric value)
3) Text378 = this field show the TAT calculation and this value comes from following formula:
Me.Text378 =IIf([Combo376]="US", IIf([Text358]<201,"1", IIf(And([Text358]>200,[Text358]<501),"2", IIf(And([Text358]>500,[Text358]<1001),"3", IIf(And([Text358]>1000,[Text358]<2001),"4", IIf(And([Text358]>2000,[Text358]<5001),"5","7"))))), IIf([Combo376]="WW", IIf([Text358]<201,"1", IIf(And([Text358]>200,[Text358]<501),"3", IIf(And([Text358]>500,[Text358]<1001),"4", IIf(And([Text358]>1000,[Text358]<2001),"5", IIf(And([Text358]>2000,[Text358]<5001),"8","10")))))))
I am trying to put this formula as:
Me.Text378 =IIf([Combo376]="US", IIf([Text358]<201,"1", IIf(And([Text358]>200,[Text358]<501),"2", IIf(And([Text358]>500,[Text358]<1001),"3", IIf(And([Text358]>1000,[Text358]<2001),"4", IIf(And([Text358]>2000,[Text358]<5001),"5","7"))))), IIf([Combo376]="WW", IIf([Text358]<201,"1", IIf(And([Text358]>200,[Text358]<501),"3", IIf(And([Text358]>500,[Text358]<1001),"4", IIf(And([Text358]>1000,[Text358]<2001),"5", IIf(And([Text358]>2000,[Text358]<5001),"8","10")))))))
into on click of an button. Which will show the calculated value in field "Text378"
Meanwhile its working great in excel however showing error in Access VBA while compling code at "And" operator in above formula.
Could anybody can help me out what exactly going wrong here.
Appericate all your effort and advise. thanks.
I have a form where there is three fields:
1) Combo376 (Combo box) = Value list "US" or "WW"
2) Text358 (Text box) = User need to enter number of locations (any numeric value)
3) Text378 = this field show the TAT calculation and this value comes from following formula:
Me.Text378 =IIf([Combo376]="US", IIf([Text358]<201,"1", IIf(And([Text358]>200,[Text358]<501),"2", IIf(And([Text358]>500,[Text358]<1001),"3", IIf(And([Text358]>1000,[Text358]<2001),"4", IIf(And([Text358]>2000,[Text358]<5001),"5","7"))))), IIf([Combo376]="WW", IIf([Text358]<201,"1", IIf(And([Text358]>200,[Text358]<501),"3", IIf(And([Text358]>500,[Text358]<1001),"4", IIf(And([Text358]>1000,[Text358]<2001),"5", IIf(And([Text358]>2000,[Text358]<5001),"8","10")))))))
I am trying to put this formula as:
Me.Text378 =IIf([Combo376]="US", IIf([Text358]<201,"1", IIf(And([Text358]>200,[Text358]<501),"2", IIf(And([Text358]>500,[Text358]<1001),"3", IIf(And([Text358]>1000,[Text358]<2001),"4", IIf(And([Text358]>2000,[Text358]<5001),"5","7"))))), IIf([Combo376]="WW", IIf([Text358]<201,"1", IIf(And([Text358]>200,[Text358]<501),"3", IIf(And([Text358]>500,[Text358]<1001),"4", IIf(And([Text358]>1000,[Text358]<2001),"5", IIf(And([Text358]>2000,[Text358]<5001),"8","10")))))))
into on click of an button. Which will show the calculated value in field "Text378"
Meanwhile its working great in excel however showing error in Access VBA while compling code at "And" operator in above formula.
Could anybody can help me out what exactly going wrong here.
Appericate all your effort and advise. thanks.