Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dlookup #error

Status
Not open for further replies.

jedrtd

Programmer
Jul 22, 2001
23
US
=DLookUp(&quot;[PMrate]&quot;,&quot;rategood&quot;,&quot;weight1> =' &quot; & Form!weight & &quot; ' And weight2< =' &quot; & Form!weight & &quot; ' &quot;)


Here is the lookup, I know it is just the &quot; ' are in the wrong place

thanks
 
Try this:

=DLookUp(&quot;[PMRate]&quot;,&quot;RateGood&quot;,&quot;[Weight1] >= '&quot; & [Forms]![MyFormName]![Weight] & &quot;' AND [Weight2] <= '&quot; & [Forms]![MyFormName]![Weight] & &quot;'&quot;)

HTH Joe Miller
joe.miller@flotech.net
 
=DLookUp(&quot;[PMRate]&quot;,&quot;RateGood&quot;,&quot;[Weight1] >= '&quot; & [Forms]![rates]![Weight] & &quot;' AND [Weight2] <= '&quot; & [Forms]![rates]![Weight] & &quot;'&quot;)

ok I I pasted it just like you had it and got a name? error, put rates in place of myformname now I get Error?

not sure what to change now

any help would be great
 
Is your text box named PMRate, Weight1 or Weight 2? If so change it. Are the Weight1 and Weight2 text datatype or number. If text should be fine, if number then you need to remove the single quotes.

HTH Joe Miller
joe.miller@flotech.net
 
pmrate is the field I im pulling the looked up value from
weigth is the field on the form

weight1 is the lowest weigth on the same table as pmrate
weight2 is the highest weight on the same table as pmrate

the weight1 and 2 fields are single/general number 4 dec.
the pmrate is money

 
I took out the single quote and I dont get an error but it isnt doing anything now
=DLookUp(&quot;[PMRate]&quot;,&quot;RateGood&quot;,&quot;[Weight1] >=&quot; & [Forms]![rates]![Weight] & &quot; AND [Weight2] <= &quot; & [Forms]![rates]![Weight] & &quot;&quot;)
 
Well the DLookup syntax looks correct to me, did you misspell the name of the control itself? I notice that you typo'd weight as &quot;weigth&quot; twice in your post, perhaps you did that when you named the control?
Joe Miller
joe.miller@flotech.net
 
Ok, I tried it with each one separate and they worked pasted below are the 2 that worked

DLookUp(&quot;[PMrate]&quot;,&quot;rategood&quot;,&quot;[Weight2] =&quot; & [Forms]![rates]![weight])

DLookUp(&quot;[PMrate]&quot;,&quot;rategood&quot;,&quot;[Weight1] =&quot; & [Forms]![rates]![weight])

so now I want to do =><= with and now if I could just get the &quot; ' and () right I think it will work,

thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top