Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / December 2005

Tip: Looking for answers? Try searching our database.

Need advise on operator compatibility using records

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
riyaz - 14 Dec 2005 03:43 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.