R
Ron
I have developed a SQL statement to coordinate a subform with 8 text boxes
in a search form with the following code:
SELECT WarehouseQuery.ID, WarehouseQuery.BoatNumber,
WarehouseQuery.SJCNumber, WarehouseQuery.QTY, WarehouseQuery.DESCRIPTION,
WarehouseQuery.Wh_Date_received, WarehouseQuery.Wh_QtyReceived,
WarehouseQuery.Wh_Location, WarehouseQuery.KitInfo,
WarehouseQuery.Wh_Comments, WarehouseQuery.Wh_Assignment,
WarehouseQuery.Date_received, WarehouseQuery.MFGNumber,
WarehouseQuery.[SupplierNumber], WarehouseQuery.Supplier_ID,
WarehouseQuery.Use_On_Boat, WarehouseQuery.Date_Ordered,
WarehouseQuery.PONumber, WarehouseQuery.Price_Per_Unit,
WarehouseQuery.COMMENTS, WarehouseQuery.Thickness_Width,
WarehouseQuery.Length, WarehouseQuery.TaskID, WarehouseQuery.JobCode,
WarehouseQuery.Inventory, WarehouseQuery.PHASE
FROM WarehouseQuery
WHERE (((WarehouseQuery.BoatNumber)=[Forms]![QBF_Form]![txtWhatBoat] Or
[Forms]![QBF_Form]![txtWhatBoat] Is Null) AND
((WarehouseQuery.SJCNumber)=[Forms]![QBF_Form]![txtWhatSJCNumber] Or
[Forms]![QBF_Form]![txtWhatSJCNumber] Is Null) AND
((WarehouseQuery.DESCRIPTION)=[Forms]![QBF_Form]![txtWhatDescription] Or
[Forms]![QBF_Form]![txtWhatDescription] Is Null) AND
((WarehouseQuery.MFGNumber)=[Forms]![QBF_Form]![txtMFGNumber] Or
[Forms]![QBF_Form]![txtMFGNumber] Is Null) AND
((WarehouseQuery.[SupplierNumber])=[Forms]![QBF_Form]![txtWhatSupplierNumber
] Or [Forms]![QBF_Form]![txtWhatSupplierNumber] Is Null) AND
((WarehouseQuery.Supplier_ID)=[Forms]![QBF_Form]![txtWhatSupplier] Or
[Forms]![QBF_Form]![txtWhatSupplier] Is Null) AND
((WarehouseQuery.PONumber)=[Forms]![QBF_Form]![txtWhatPONumber] Or
[Forms]![QBF_Form]![txtWhatPONumber] Is Null) AND
((WarehouseQuery.JobCode)=[Forms]![QBF_Form]![txtWhatJobCode] Or
[Forms]![QBF_Form]![txtWhatJobCode] Is Null));
The text boxes can be left null or can have a value to determine what shows
up in the sub form. Sometimes it works fine and other times I get a message
that the query is too long and will be trunkated or the query is too
complex. Does anyone have any ideas what can be done to get consistant
results.
Thanks for any help,
Ron
in a search form with the following code:
SELECT WarehouseQuery.ID, WarehouseQuery.BoatNumber,
WarehouseQuery.SJCNumber, WarehouseQuery.QTY, WarehouseQuery.DESCRIPTION,
WarehouseQuery.Wh_Date_received, WarehouseQuery.Wh_QtyReceived,
WarehouseQuery.Wh_Location, WarehouseQuery.KitInfo,
WarehouseQuery.Wh_Comments, WarehouseQuery.Wh_Assignment,
WarehouseQuery.Date_received, WarehouseQuery.MFGNumber,
WarehouseQuery.[SupplierNumber], WarehouseQuery.Supplier_ID,
WarehouseQuery.Use_On_Boat, WarehouseQuery.Date_Ordered,
WarehouseQuery.PONumber, WarehouseQuery.Price_Per_Unit,
WarehouseQuery.COMMENTS, WarehouseQuery.Thickness_Width,
WarehouseQuery.Length, WarehouseQuery.TaskID, WarehouseQuery.JobCode,
WarehouseQuery.Inventory, WarehouseQuery.PHASE
FROM WarehouseQuery
WHERE (((WarehouseQuery.BoatNumber)=[Forms]![QBF_Form]![txtWhatBoat] Or
[Forms]![QBF_Form]![txtWhatBoat] Is Null) AND
((WarehouseQuery.SJCNumber)=[Forms]![QBF_Form]![txtWhatSJCNumber] Or
[Forms]![QBF_Form]![txtWhatSJCNumber] Is Null) AND
((WarehouseQuery.DESCRIPTION)=[Forms]![QBF_Form]![txtWhatDescription] Or
[Forms]![QBF_Form]![txtWhatDescription] Is Null) AND
((WarehouseQuery.MFGNumber)=[Forms]![QBF_Form]![txtMFGNumber] Or
[Forms]![QBF_Form]![txtMFGNumber] Is Null) AND
((WarehouseQuery.[SupplierNumber])=[Forms]![QBF_Form]![txtWhatSupplierNumber
] Or [Forms]![QBF_Form]![txtWhatSupplierNumber] Is Null) AND
((WarehouseQuery.Supplier_ID)=[Forms]![QBF_Form]![txtWhatSupplier] Or
[Forms]![QBF_Form]![txtWhatSupplier] Is Null) AND
((WarehouseQuery.PONumber)=[Forms]![QBF_Form]![txtWhatPONumber] Or
[Forms]![QBF_Form]![txtWhatPONumber] Is Null) AND
((WarehouseQuery.JobCode)=[Forms]![QBF_Form]![txtWhatJobCode] Or
[Forms]![QBF_Form]![txtWhatJobCode] Is Null));
The text boxes can be left null or can have a value to determine what shows
up in the sub form. Sometimes it works fine and other times I get a message
that the query is too long and will be trunkated or the query is too
complex. Does anyone have any ideas what can be done to get consistant
results.
Thanks for any help,
Ron