Filter a query based on a text box value

crossy5575

Registered User.
Local time
Today, 19:19
Joined
Apr 21, 2015
Messages
46
Hi there,

I have a simple query, which filters a long list of data into criteria based on the tab label in the form.

the sql is as follows:

SELECT tblproductdb.PC_Code AS Code, tblproductdb.PC_Page AS Page, tblproductdb.PC_desc AS [Desc], tblproductdb.size AS [Size], tblproductdb.grouping_code, tblorderprodsdetail.purchasequantity AS Quantity, tblorderprodsdetail.purchasedelivered, tblproductgroup.Purchasepr AS Price, tblproductgroup.[2ndgrouping], [purchasepr]*[purchasequantity] AS Total
FROM tblproductgroup INNER JOIN (tblproductdb LEFT JOIN tblorderprodsdetail ON tblproductdb.[PC_Code] = tblorderprodsdetail.[purchaseitem]) ON tblproductgroup.grouping_code = tblproductdb.grouping_code
WHERE (((tblproductgroup.[2ndgrouping])=[text179].[value]));

where [text179].[value] is a textbox with a number in it which highlights the tab number and thus filter the data.

the only problem is when i load the form (or run the query) it asks for a parameter value.

is there a way to set a default value if text179 is null, or on load value =1?

thanks

Simon
 
thank you! I had the default setting, just wondered why it wouldnt work!!!
much appreciated - i can now sleep easily!
 

Users who are viewing this thread

Back
Top Bottom