evaluate select query

  • Thread starter Thread starter LGarcia
  • Start date Start date
L

LGarcia

Hi all,
Here is the SQL from a query. I need to evaluate if this query returns
anything. If no records are returned then do something and if records are
returned do something else. Not sure how to do this using code.

SELECT tblIntakedta.SUBJECT, tblIntakedta.INTDATE
FROM tblIntakedta
WHERE (((tblIntakedta.SUBJECT)=[forms]![nutrientSelect1].[list30]) AND
((tblIntakedta.INTDATE)=[forms]![nutrientSelect1].[list32]));

Hope someone can help.
TIA
LGarcia
 
The one way I have figured out how to do this is create a View in SQL. Then
in code dim a variable to do a dlookup on the View and then write your code
somehting like this
Dim test
test = dlookup("[fieldname]","ViewName")
if isnull(test) then
else
end if
 
Back
Top