this is my table structure
lower upper price
100 200 $7.20
200 300 $8.10
300 400 $10.90
from here i want to extract the price depend the input limit value
for eg:// if the limit value entered in textbox is 150 .it should
navigate the table
and give the correct price for this limit value.
my code is:
Do Until rstAISI4140NQT.EOF
If Txtlimit.Value <= rstAISI4140NQT("upper") And Txtlimit.Value >=
rstAISI4140NQT("lower") Then
Txtpkg.Value = rstAISI4140NQT("price")
MsgBox (" price calculated ")
Exit Do
Exit Sub
End If
rstAISI4140NQT.MoveNext
Loop
by this code i cannot get the price value..i found frm this code that
operator
"<=" doesnot work in this looping..
plz give me some solution
Dirk - 14 Dec 2005 10:50 GMT
Does it help if you change it to:
If CInt(Txtlimit.Value) <= CInt(rstAISI4140NQT("upper")) And
CInt(Txtlimit.Value) >= CInt(rstAISI4140NQT("lower")) Then
Let me know.
It seems like some data gets misinterpreted. Better make sure all data his
handled as an integer.
> this is my table structure
>
[quoted text clipped - 40 lines]
>
> plz give me some solution
riyaz - 15 Dec 2005 01:25 GMT
hi dirk
thanks for your code ,it works fine.
regards
riyaz
> Does it help if you change it to:
>
[quoted text clipped - 50 lines]
> >
> > plz give me some solution
Alex Dybenko - 14 Dec 2005 10:54 GMT
<= should work, try to debug your code to see what really happens
you can also use query to get this price:
strSQL="Select Price from AISI4140NQT where " & Txtlimit.Value & " Between
upper AND lower"
then open recordset based on this sql and get the price

Signature
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com
> this is my table structure
>
[quoted text clipped - 36 lines]
>
> plz give me some solution