N
Nick hfrupn
I enter selection data into a sub form, frmMainWorkCentreInclude, with a
field MainWorkCentre. This data is stored in a table, tbMainWorkCentreInclude
and this table is used as the selection criteria for a query on another
table. I have posted the SQL below.
This works fine when there is data in the table. My question is how can I
get the query to return all data when the table is blank and only the data
specified when the table is not blank.
Regards
Nick
SELECT qOrder19SystemStatusOp.Order, qOrder19SystemStatusOp.[Order Type],
qOrder19SystemStatusOp.[Bas# start date], qOrder19SystemStatusOp.[Short
text], qOrder19SystemStatusOp.FunctLocation, qOrder19SystemStatusOp.[Planner
group], qOrder19SystemStatusOp.[Main WorkCtr],
qOrder19SystemStatusOp.Priority, qOrder19SystemStatusOp.[Entered by],
qOrder19SystemStatusOp.tbHeader.SystemCondition,
qOrder19SystemStatusOp.Revision, qOrder19SystemStatusOp.tbHeader.[System
Status], qOrder19SystemStatusOp.[User status],
qOrder19SystemStatusOp.[Oper#/Act#], qOrder19SystemStatusOp.[Control key],
qOrder19SystemStatusOp.[Work Center], qOrder19SystemStatusOp.[Opr# short
text], qOrder19SystemStatusOp.[Normal duration],
qOrder19SystemStatusOp.Number, qOrder19SystemStatusOp.Work,
qOrder19SystemStatusOp.tbOperations.SystemCondition,
qOrder19SystemStatusOp.[Earl#start date],
qOrder19SystemStatusOp.tbOperations.[System Status],
qOrder19SystemStatusOp.Recipient, qOrder19SystemStatusOp.[Std text key]
FROM qOrder19SystemStatusOp
WHERE (((qOrder19SystemStatusOp.[Main WorkCtr]) In (SELECT [MainWorkCentre]
FROM [tbMainWorkCentreInclude])));
field MainWorkCentre. This data is stored in a table, tbMainWorkCentreInclude
and this table is used as the selection criteria for a query on another
table. I have posted the SQL below.
This works fine when there is data in the table. My question is how can I
get the query to return all data when the table is blank and only the data
specified when the table is not blank.
Regards
Nick
SELECT qOrder19SystemStatusOp.Order, qOrder19SystemStatusOp.[Order Type],
qOrder19SystemStatusOp.[Bas# start date], qOrder19SystemStatusOp.[Short
text], qOrder19SystemStatusOp.FunctLocation, qOrder19SystemStatusOp.[Planner
group], qOrder19SystemStatusOp.[Main WorkCtr],
qOrder19SystemStatusOp.Priority, qOrder19SystemStatusOp.[Entered by],
qOrder19SystemStatusOp.tbHeader.SystemCondition,
qOrder19SystemStatusOp.Revision, qOrder19SystemStatusOp.tbHeader.[System
Status], qOrder19SystemStatusOp.[User status],
qOrder19SystemStatusOp.[Oper#/Act#], qOrder19SystemStatusOp.[Control key],
qOrder19SystemStatusOp.[Work Center], qOrder19SystemStatusOp.[Opr# short
text], qOrder19SystemStatusOp.[Normal duration],
qOrder19SystemStatusOp.Number, qOrder19SystemStatusOp.Work,
qOrder19SystemStatusOp.tbOperations.SystemCondition,
qOrder19SystemStatusOp.[Earl#start date],
qOrder19SystemStatusOp.tbOperations.[System Status],
qOrder19SystemStatusOp.Recipient, qOrder19SystemStatusOp.[Std text key]
FROM qOrder19SystemStatusOp
WHERE (((qOrder19SystemStatusOp.[Main WorkCtr]) In (SELECT [MainWorkCentre]
FROM [tbMainWorkCentreInclude])));