PC Review


Reply
Thread Tools Rate Thread

Lookup Query Help

 
 
mattc66 via AccessMonster.com
Guest
Posts: n/a
 
      24th Jan 2007
Hi All,

I need to build a query that will display the data bases on the range of a 2
cells.

We build heaters and CuFt Size of your room determines that Heater KW you
need.

So I have a table with the CuFt Min and CuFt Max and the corrisponding Heater
KW.

The user will enter the Room CuFt in a form and I want to display the Heater
KW(s) that would work for the room size. So if the user entered 125 the
result would be 3.0 KW and 4.5 KW.

How would I write my query so that it can look up this info.

Room Size HEATER
CuFt Min CuFt Max KW
45 100 2.1
70 150 3.0
100 210 4.5
175 310 6.0
250 425 8.0
390 600 10.5
510 740 12.0
630 950 14.4

Thanks
Matt

--
Matt Campbell
mattc (at) saunatec [dot] com

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...eries/200701/1

 
Reply With Quote
 
 
 
 
Marshall Barton
Guest
Posts: n/a
 
      24th Jan 2007
mattc66 via AccessMonster.com wrote:
>I need to build a query that will display the data bases on the range of a 2
>cells.
>
>We build heaters and CuFt Size of your room determines that Heater KW you
>need.
>
>So I have a table with the CuFt Min and CuFt Max and the corrisponding Heater
>KW.
>
>The user will enter the Room CuFt in a form and I want to display the Heater
>KW(s) that would work for the room size. So if the user entered 125 the
>result would be 3.0 KW and 4.5 KW.
>
>How would I write my query so that it can look up this info.
>
>Room Size HEATER
>CuFt Min CuFt Max KW
>45 100 2.1
>70 150 3.0
>100 210 4.5
>175 310 6.0
>250 425 8.0
>390 600 10.5
>510 740 12.0
>630 950 14.4



If you are just using this as a quich calculation, may be
that this simple query is all you need.

SELECT KW
FROM table
WHERE [Enter Room Square Feet]
Between [CuFt Min] And [CuFt Max]

If you want to do this on a form where users are entering
other data, then try using a text box with this kind of
expression:
=DLookup("KW, "table", txtRSqSf & " Between [CuFt Min] And
[CuFt Max]")

where txtRSqSf is the name of the text box where users enter
the room size.

--
Marsh
MVP [MS Access]
 
Reply With Quote
 
 
 
 
mattc66 via AccessMonster.com
Guest
Posts: n/a
 
      25th Jan 2007
when I tried the first suggestion I got a prompt for [Enter Room Square Feet]
and a prompt for [CuFt Min] and a prompt for [CuFt Max]. It should have only
prompted for the Room Square Feet.

SELECT KW
FROM tblHeaterCuFt
WHERE [Enter Room Square Feet] Between [CuFt Min] And [CuFt Max];

Marshall Barton wrote:
>>I need to build a query that will display the data bases on the range of a 2
>>cells.

>[quoted text clipped - 21 lines]
>>510 740 12.0
>>630 950 14.4

>
>If you are just using this as a quich calculation, may be
>that this simple query is all you need.
>
>SELECT KW
>FROM table
>WHERE [Enter Room Square Feet]
> Between [CuFt Min] And [CuFt Max]
>
>If you want to do this on a form where users are entering
>other data, then try using a text box with this kind of
>expression:
>=DLookup("KW, "table", txtRSqSf & " Between [CuFt Min] And
>[CuFt Max]")
>
>where txtRSqSf is the name of the text box where users enter
>the room size.
>


--
Matt Campbell
mattc (at) saunatec [dot] com

Message posted via http://www.accessmonster.com

 
Reply With Quote
 
Marshall Barton
Guest
Posts: n/a
 
      25th Jan 2007
Your question indicated that "CuFt Min CuFt Max KW" were
the field names in the table. Apparently, that's not the
case, so you'll have to change them to whatever the real
names are.
--
Marsh
MVP [MS Access]


mattc66 via AccessMonster.com wrote:

>when I tried the first suggestion I got a prompt for [Enter Room Square Feet]
>and a prompt for [CuFt Min] and a prompt for [CuFt Max]. It should have only
>prompted for the Room Square Feet.
>
>SELECT KW
>FROM tblHeaterCuFt
>WHERE [Enter Room Square Feet] Between [CuFt Min] And [CuFt Max];
>
>Marshall Barton wrote:
>>>I need to build a query that will display the data bases on the range of a 2
>>>cells.

>>[quoted text clipped - 21 lines]
>>>510 740 12.0
>>>630 950 14.4

>>
>>If you are just using this as a quich calculation, may be
>>that this simple query is all you need.
>>
>>SELECT KW
>>FROM table
>>WHERE [Enter Room Square Feet]
>> Between [CuFt Min] And [CuFt Max]
>>
>>If you want to do this on a form where users are entering
>>other data, then try using a text box with this kind of
>>expression:
>>=DLookup("KW, "table", txtRSqSf & " Between [CuFt Min] And
>>[CuFt Max]")
>>
>>where txtRSqSf is the name of the text box where users enter
>>the room size.
>>


 
Reply With Quote
 
mattc66 via AccessMonster.com
Guest
Posts: n/a
 
      25th Jan 2007
Thank you - yes I discovered that after I replied. Work great, thanks.

Marshall Barton wrote:
>Your question indicated that "CuFt Min CuFt Max KW" were
>the field names in the table. Apparently, that's not the
>case, so you'll have to change them to whatever the real
>names are.
>>when I tried the first suggestion I got a prompt for [Enter Room Square Feet]
>>and a prompt for [CuFt Min] and a prompt for [CuFt Max]. It should have only

>[quoted text clipped - 26 lines]
>>>where txtRSqSf is the name of the text box where users enter
>>>the room size.


--
Matt Campbell
mattc (at) saunatec [dot] com

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...eries/200701/1

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
lookup help. lookup result based on data in 2 columns lcc Microsoft Excel Worksheet Functions 3 6th Apr 2010 01:20 PM
Lookup Lookup Lookup =?Utf-8?B?TVI=?= Microsoft Excel Worksheet Functions 2 10th Mar 2005 02:59 AM
HELP NEEDED FAST!!! HELP HELP HELP HELP HELP HELP FAST HELP NEEDED Jonathan Windows XP General 10 13th Jan 2005 03:22 AM
Lookup - V Lookup HELP ME Microsoft Excel Misc 12 25th Dec 2003 07:32 PM
Help! Help! Help! Help! Help! Help! Help! Help! Help! Help! Help! Help! Help! -$- Windows XP Internet Explorer 2 21st Dec 2003 11:45 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:11 AM.