run sql if value not in table?

  • Thread starter Thread starter zionsaal
  • Start date Start date
Z

zionsaal

how do I create a if then statment like this
if me."controlname" is in this table where... then run sql
else
dont run

anyone can help?
thanks
 
Hi,

How about something like this:

if not isnull(dlookup("FIELDNAME", "TABLENAME", "FIELDNAME = " &
me.CONTROL)) then
' run your sql code
docmd.runsql "SQL code goes here"
endif

Damian.
 
Hi,

How about something like this:

if not isnull(dlookup("FIELDNAME", "TABLENAME", "FIELDNAME = " &
me.CONTROL)) then
' run your sql code
docmd.runsql "SQL code goes here"
endif

Damian.






- Show quoted text -

thank you!!! Damian
 

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

Back
Top