Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Block exceptions

Status
Not open for further replies.

razchip

Technical User
Feb 2, 2001
133
US
I have a table where I need to block a number of entries that can change. The table has hundreds of job numbers. I have another table with exception job numbers (EJN). I want the EJN's to be blocked in my query. Is there a way to do a lookup or vba code to block these EJN's from comming through, changes and to many to do a "not like" statement?

Thanks for the help.
Greg
 
How about something like (replace field names and table names as appropriate):
Code:
Select ymt.* from [yourmaintable] ymt
where ymt.Jobnum Not IN 
(Select distinct ejn.Jobnum from [yourexceptiontable] ejb)

That assumes that your users only have table access from a form or a query that you provide to them - not direct table access.


Greg
People demand freedom of speech as a compensation for the freedom of thought which they seldom use. Kierkegaard
 
Thanks, this worked just fine.

Thanks for the help.
Greg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top