Microsoft Access Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft Access Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #16  
Old May 13th, 2008, 03:03 PM
don94403's Avatar
don94403 don94403 is offline
Contributing User
ASP Free Intermediate (1500 - 1999 posts)
 
Join Date: Jan 2007
Location: Northern California
Posts: 1,596 don94403 User rank is Major (30000 - 40000 Reputation Level)don94403 User rank is Major (30000 - 40000 Reputation Level)don94403 User rank is Major (30000 - 40000 Reputation Level)don94403 User rank is Major (30000 - 40000 Reputation Level)don94403 User rank is Major (30000 - 40000 Reputation Level)don94403 User rank is Major (30000 - 40000 Reputation Level)don94403 User rank is Major (30000 - 40000 Reputation Level)don94403 User rank is Major (30000 - 40000 Reputation Level)don94403 User rank is Major (30000 - 40000 Reputation Level)don94403 User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Week 5 Days 4 h 51 m 18 sec
Reputation Power: 317
Quote:
Originally Posted by slwight
This is going to be easy most likely, but I've been searching and trying different things with no luck.

I have my tblEquip and tblAssets (Equip has all the items I am looking for and Assets are the items that I have found). I can do a SELECT query to see all of the ones I found. I even have it set up to remove the found items from a copy of tblEquip.

However, I can not figure out a way to check to see what items in tblAssets are NOT on tblEquip. In the event that I find an item that isnt listed in tblEquip, I'd like to figure out what those items are. I've been messing around with the SELECT query with the WHERE tblAssets.AssetID <> tblEquip.Tag, but no luck.

Any suggestions? Basically want a way to look up all the items I found in tblAssets that aren't on tblEquip. Thanks!

You'll need to write a subquery. It might look something like this, although there are several alternate ways to do it:
Code:
SELECT * FROM tblAssets
  WHERE AssetID NOT IN (SELECT Tag from tblEquip WHERE Tag = tblAssets.AssetID)

Check out: http://msdn.microsoft.com/en-us/lib...2(SQL.100).aspx

This is a fairly common requirement, but it's not intuitive and stumps a lot of people until they are shown how it can be done.
__________________
Experience is the thing you have left when everything else is gone.

Reply With Quote
  #17  
Old May 13th, 2008, 08:20 PM
slwight slwight is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 10 slwight User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 42 m 27 sec
Reputation Power: 0
Quote:
Originally Posted by don94403
You'll need to write a subquery. It might look something like this, although there are several alternate ways to do it:
Code:
SELECT * FROM tblAssets
  WHERE AssetID NOT IN (SELECT Tag from tblEquip WHERE Tag = tblAssets.AssetID)

Check out: http://msdn.microsoft.com/en-us/lib...2(SQL.100).aspx

This is a fairly common requirement, but it's not intuitive and stumps a lot of people until they are shown how it can be done.


That helped a lot. Thanks! Didnt know about subqueries at all. This little project for work is coming to an end. However, just a slight annoyance.

My main form, frmDataEntry, has buttons to open 3 other forms (frmAddNewLoc, frmAddNewPort, frmQryAndRpt). I have a macro opening frmQryAndRpt, but I use VBA coding to open the other two. However, the buttons will ONLY open these 2 forms if I only open them first. Otherwise, I get an error saying: "Access cant find the form '<form name>' referred to in a macro expression or visual basic code."

I keep messing around with this, just wondering if I'm missing something.

Reply With Quote
  #18  
Old May 13th, 2008, 08:51 PM
slwight slwight is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 10 slwight User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 42 m 27 sec
Reputation Power: 0
Quote:
Originally Posted by slwight
That helped a lot. Thanks! Didnt know about subqueries at all. This little project for work is coming to an end. However, just a slight annoyance.

My main form, frmDataEntry, has buttons to open 3 other forms (frmAddNewLoc, frmAddNewPort, frmQryAndRpt). I have a macro opening frmQryAndRpt, but I use VBA coding to open the other two. However, the buttons will ONLY open these 2 forms if I only open them first. Otherwise, I get an error saying: "Access cant find the form '<form name>' referred to in a macro expression or visual basic code."

I keep messing around with this, just wondering if I'm missing something.


Nevermind, I got it working. The project is done! Thanks again for all your help. Its been very helpful and I really appreciate all that you did. Take care!

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > Recordsets


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway