Navigation: Main Page » Computer / Recreational / Science / Society / Television
 
Web N-N-A.com
         
Computer Groups Forum Index  »  Databases - Microsoft Access  »  yet another DLookup Multiple Criteria
Page 1 of 1    
Author Message
Guest
Posted: Wed Dec 03, 2008 10:59 pm
= DLookup("[LastOfSoil Moisture Reading]", "qryEcho5Sensors", "Station
= " & Forms![frmStationEchoSensors]!Station & " And Sensor Name =" &
Forms![frmStationEchoSensors]!Station)

I need this code to find the "LastOfSoil Moisture Reading" - (decimal
number) value in the "qryEcho5Sensors" query based on the value of the
Station (text) AND Sensor Name (text) in the "frmStationEchoSensors"
form. The form is continuous. Am I even close or is this way off
base?
franc sutherland
Posted: Thu Dec 04, 2008 10:03 am
Guest
On Dec 3, 10:59 pm, markm....@gmail.com wrote:
Quote:
= DLookup("[LastOfSoil Moisture Reading]", "qryEcho5Sensors", "Station
= " & Forms![frmStationEchoSensors]!Station & " And Sensor Name =" &
Forms![frmStationEchoSensors]!Station)

I need this code to find the "LastOfSoil Moisture Reading" - (decimal
number) value in the "qryEcho5Sensors" query based on the value of the
Station (text) AND Sensor Name (text) in the "frmStationEchoSensors"
form.  The form is continuous.  Am I even close or is this way off
base?

Hi,

It looks fine to me. What do you get?

Franc.
Phil Stanton
Posted: Thu Dec 04, 2008 4:33 pm
Guest
At least I think you need the last bit to read

" And Sensor Name = '" & Forms![frmStationEchoSensors]!Station) & "'"

How I hate single & double quotation marks. A text field like
Forms![frmStationEchoSensors]!Station) should have single quotation marks
either side.

I am also somewhat surprised that you say Station is a decimal number. I
would havr thought it should be integer, and possible an AutoNumber Key to
the station table

Phil


<markm.gis@gmail.com> wrote in message
news:9e57d4b9-7845-4132-8ca1-e9caa0bc5c10@q26g2000prq.googlegroups.com...
Quote:
= DLookup("[LastOfSoil Moisture Reading]", "qryEcho5Sensors", "Station
= " & Forms![frmStationEchoSensors]!Station & " And Sensor Name =" &
Forms![frmStationEchoSensors]!Station)

I need this code to find the "LastOfSoil Moisture Reading" - (decimal
number) value in the "qryEcho5Sensors" query based on the value of the
Station (text) AND Sensor Name (text) in the "frmStationEchoSensors"
form. The form is continuous. Am I even close or is this way off
base?
paii, Ron
Posted: Thu Dec 04, 2008 4:33 pm
Guest
<markm.gis@gmail.com> wrote in message
news:9e57d4b9-7845-4132-8ca1-e9caa0bc5c10@q26g2000prq.googlegroups.com...
Quote:
= DLookup("[LastOfSoil Moisture Reading]", "qryEcho5Sensors", "Station
= " & Forms![frmStationEchoSensors]!Station & " And Sensor Name =" &
Forms![frmStationEchoSensors]!Station)

I need this code to find the "LastOfSoil Moisture Reading" - (decimal
number) value in the "qryEcho5Sensors" query based on the value of the
Station (text) AND Sensor Name (text) in the "frmStationEchoSensors"
form. The form is continuous. Am I even close or is this way off
base?

You need to add brackets around [Sensor Name]. Also I assume [Sensor Name]
is a string, so you will need to add quotes around the parameter. If
[Station] is a string, it will also need quotes.

= DLookup("[LastOfSoil Moisture Reading]", "qryEcho5Sensors", "[Station] = "
& Forms![frmStationEchoSensors]!Station &
" And [Sensor Name] ='" & Forms![frmStationEchoSensors]!Station & "'")
 
Page 1 of 1       All times are GMT
The time now is Wed Jan 07, 2009 3:10 am