evaluate select query

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
 
S

Stephanie Neveu

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top