qurey- where issue

abbers_01

Registered User.
Local time
Yesterday, 21:15
Joined
Aug 31, 2007
Messages
45
I have a list box that is updated by a query, here is my query:
_________________________________________________________________
SELECT [Work Order Content].[WO ID], [Work Order Content].[Work Order Number], [Work Order Content].[WO Date Ordered], [Work Order Content].[WO Date Needed]
FROM [Work Order Content]
WHERE ([Work Order Content].[Work Order Number]=Forms![open Doc]![WO Number]) Or ([Work Order Content].[WO date ordered]=Forms![open Doc]![WO date ordered])
ORDER BY [Work Order Content].[WO ID];
_________________________________________________________________

In the form I have textboxes to set the criteria, what I want is for this to be subtractive, when I open the form all Work Orders are shown and as I change criteria it weeds out Work orders that don't fit the criteria. What must I change to fulfill this requirement. I personally was thinking there must be something better than 'OR' to use, but I really have no idea.
 
I also used AND and that wasn't working for me either
 
not that anyones replied but I figured this out so don't bother replying if you were going to

it appears I just didn't have my textbox doing a requery of the listbox
incase anyone looks at this and wonders the coded I used it is as follows
_________________________________________________________________
SELECT [Work Order Content].[WO ID], [Work Order Content].[Work Order Number], [Work Order Content].[WO Date Ordered]
FROM [Work Order Content]
WHERE ((([Work Order Content].[Work Order Number])=Forms![open Doc]![WO Number]) Or ((Forms![open Doc]![WO Number]) Is Null)) And ((([Work Order Content].[WO Date Ordered])=Forms![open Doc]![WO date ordered]) Or ((Forms![open Doc]![WO date ordered]) Is Null))
ORDER BY [Work Order Content].[WO ID];
_________________________________________________________________
I then have afterUpdate events on my [Work Order Number] and WO [date ordered] inputs that requery my listBox.
 

Users who are viewing this thread

Back
Top Bottom