473,399 Members | 2,478 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

What is the syntax in MS Access VB for NOT Exists

I am tring to write a MS Access VB code to pull records from a table Consultant where a record does not exist in the table Reviews with the following criteria
Consultant.Id = Reviews.ConsultantId
Reviews.ReviewType = Year End
Reviews.ReviewYear = 2010
Consultant.Status = Active

The SQL below works as part of a query

Expand|Select|Wrap|Line Numbers
  1. SELECT CONSULTANT.ID, CONSULTANT.LastName, CONSULTANT.Status
  2. FROM CONSULTANT
  3. WHERE (((CONSULTANT.Status)="Active") AND ((NOT Exists (SELECT * FROM REVIEWS
  4. WHERE CONSULTANT.ID = REVIEWS.ConsultantId 
  5. AND REVIEWS.ReviewType = "Year End" 
  6. AND REVIEWS.ReviewYear = 2010))));
However, I need to call this from my VB code so i can create Reviews for the missing records.
Nov 16 '10 #1
1 2373
NeoPa
32,556 Expert Mod 16PB
I expect the proper way in any SQL would be to use a LEFT JOIN in the FROM clause and say ON Reviews.ConsultantID IS NULL.

I'm not sure where VBA even comes into this question, but obviously, were you to need to create your SQL string in VBA before applying it then you would similarly have to write it to produce such SQL.
Nov 17 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Jarrod Morrison | last post by:
Hi All Im still pretty new to using stored procedures and am not sure what syntax i should be using. The variable @LocationID will be something along the lines of 002, 003 and so on. What i want...
1
by: Just_Buy | last post by:
Environment: MS Access 97 Problem: Trying to force a record to update using the recordset.Update property. What syntax do I need to force a record to be updated? I have searched the...
2
by: MLH | last post by:
At first, I thought it might be WhichFormOpenedMe.SetFocus, but I don' think so. Anyone know the answer?
8
by: Paul E Collins | last post by:
Does anyone else think it would be nice to be able to write something like this ... public SomeType P { v; } .... rather than this? public SomeType P { get { return v; }
14
by: clarence_rollins | last post by:
I've read that the framework is completely accessible to c#. Is that true for VB? If not, what parts of the framework are not accessible to VB?
1
by: MLH | last post by:
If an application sends emails at certain times of the week, checking internet connectivity before attempting the sends is something I would like to do. What's the simplest thing I can do in VBA...
7
by: Stephen Martinelli | last post by:
Can anyone tell me why this statement works with sql server with VB.net but crashes when run against a access mdb?....What do I need to change here guys? Update tblInvoice set ar_totalPaid =...
0
by: kesz1 | last post by:
Hello; I am trying to run a not exists statement but I keep getting the bellow error: "Check the manual to use the right syntax near 'EXISTS (SELECT REQUESTOR FROM banner WHERE Email=R' " ...
0
MMcCarthy
by: MMcCarthy | last post by:
Rather than using the Access design view change the view to SQL. I am going to attempt to outline the general syntax used for SQL queries in Access. Angle brackets <> are used in place of some...
5
by: sierra7 | last post by:
Hi Using Access 2002 on XP I want to run the subroutine of the After Update event of a control in a sub form after 'inserting' a value from elsewhere. My main form is and the subform is ,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.