PC Review


Reply
Thread Tools Rate Thread

change to SQL - where and what?

 
 
John B. Smotherman
Guest
Posts: n/a
 
      2nd Jun 2010
I tried posting this question before but got an error response from the
server. I apologize in advance if this try results in duplicate posts...

First some background (running Access2007 on XP Pro):
Our inventory database has a form (frmCheckOut) containing a subform
(sfmCheckOutList) for an employee to fill out when taking equipment to a
remote location. The subform is displayed in datasheet view, and is populated
via VBA code that transfers selections in a listbox on a popup form
(frmAddItems). The listbox is populated via SQL code in the RowSource
property of the control:

SELECT qryAddItems.ID_Number, qryAddItems.ItemName,
qryAddItems.ItemDescription, qryAddItems.Manufacturer,
qryAddItems.ModelNumber, qryAddItems.SerialNumber,
qryAddItems.CurrentLocation FROM qryAddItems ORDER BY [ID_Number];

This SQL code refers to a query rather than the main items table, for it
applies some selection criteria necessary to make sure the item is available
for checkout (not already checked out to someone else, not in the calibration
lab, small enough to transport, etc).

Now my questions:
1. Because the popup form may be opened and closed multiple time, with
transfers to the subform each time, I'd like to implement a further criteria:
not already listed in the subform.
2. Would it be best to place this criteria in the query qryAddItems, or in
the SQL for the RowSource of the listbox control?
3. What would the SQL for this look like? I've already tried the following
snippet as a criteria in the query:

....WHERE (((tblItems.ID_Number) Not In
([forms]![frmCheckOut]![sfmCheckOutList]![hrID])) AND...

which resulted in only the first item in the subform not being shown. I know
I'm close. What am I missing?

Thanks!
 
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
Use date modified to change format & create filter to track change =?Utf-8?B?UEFS?= Microsoft Excel Worksheet Functions 0 15th Nov 2006 09:17 PM
Change conditional formatting to coloured alternate rows dependent on a change in date? StargateFan Microsoft Excel Programming 4 2nd Aug 2006 11:28 AM
how to change the value of Request.ServerVariables["HTTP_REFERER"] on the ser ver? if not possible is there some way to change it by sending back javascript to the client and having the client automaticaly do something to change the value o Daniel Microsoft Dot NET Framework 1 14th Jul 2005 03:24 PM
how to change the value of Request.ServerVariables["HTTP_REFERER"] on the ser ver? if not possible is there some way to change it by sending back javascript to the client and having the client automaticaly do something to change the value o Daniel Microsoft C# .NET 1 14th Jul 2005 02:12 PM
how to change the value of Request.ServerVariables["HTTP_REFERER"] on the ser ver? if not possible is there some way to change it by sending back javascript to the client and having the client automaticaly do something to change the value o Daniel Microsoft Dot NET 0 14th Jul 2005 10:02 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:02 AM.