PC Review


Reply
Thread Tools Rate Thread

run sql if value not in table?

 
 
zionsaal@gmail.com
Guest
Posts: n/a
 
      21st Feb 2007
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

 
Reply With Quote
 
 
 
 
=?Utf-8?B?RGFtaWFuIFM=?=
Guest
Posts: n/a
 
      22nd Feb 2007
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.

"(E-Mail Removed)" wrote:

> 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
>
>

 
Reply With Quote
 
zionsaal@gmail.com
Guest
Posts: n/a
 
      22nd Feb 2007
On Feb 21, 6:09 pm, Damian S <Dami...@discussions.microsoft.com>
wrote:
> 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.
>
>
>
> "zions...@gmail.com" wrote:
> > 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- Hide quoted text -

>
> - Show quoted text -


thank you!!! Damian

 
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
To have month and year as part of the table name in CREATE TABLE or MAKE TABLE Query ichew@scs.com.sg Microsoft Access Getting Started 1 18th Apr 2006 07:38 AM
Create Table Primary Key after Make Table Query And Update Table =?Utf-8?B?Uk5VU1pAT0tEUFM=?= Microsoft Access Queries 1 3rd May 2005 09:07 PM
Toolbar option available for TABLE>INSERT>TABLE to enclose text into a table? StargateFan Microsoft Word New Users 5 30th Jan 2005 12:10 AM
changing angeslinked table path when table owner in source table ch rusl3@optonline.net Microsoft Access External Data 1 16th Nov 2003 06:51 AM
Could not load type VTFixup Table from assembly Invalid token in v-table fix-up table. David Williams Microsoft ASP .NET 2 12th Aug 2003 09:55 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:30 PM.