crossy5575
Registered User.
- Local time
- Today, 04:33
- Joined
- Apr 21, 2015
- Messages
- 46
Hi there,
I have a form, which has a subform which is tabbed
The tabbed subform has the same query on each page, however filters is based on the tab number. (this was the easiest way of of showing lots of data)
The query runs and the query changes for each tab, however on the form loading it asks for the parameter value for the query - obviously as the query loads first before the tabbed section.
I want to put into the query sql a setting to show if the tab value is "" then just make it 1 so that the form loads without error.
I have got this far
SELECT tblproductdb.PC_Code AS Code, tblproductdb.PC_Page AS Page, tblproductdb.PC_desc AS [Desc], tblproductdb.size AS [Size], tblproductgroup.Purchasepr AS Price, tblorder1.quantity AS Quantity, [purchasepr]*[quantity] AS Total, tblproductgroup.grouping_code AS GC1, tblproductgroup.PC_group AS GC1a, tblproductgroup.[2ndgrouping] AS GC2, tblprodgroup2.Group AS GC2a
FROM (tblprodgroup2 INNER JOIN tblproductgroup ON tblprodgroup2.ID = tblproductgroup.[2ndgrouping]) INNER JOIN (tblproductdb LEFT JOIN tblorder1 ON tblproductdb.PC_Code = tblorder1.itemno) ON tblproductgroup.grouping_code = tblproductdb.grouping_code
WHERE (((tblproductgroup.[2ndgrouping])=IIf(IsNull([Form]![prodtab].[value]),1) Or (tblproductgroup.[2ndgrouping])=Nz([Form]![prodtab].[value],1)));
where form!prodtab is the subform
I dont want to put the mainform name in, as the query is used on another form.... Help please its driving me mad!!!
I have a form, which has a subform which is tabbed
The tabbed subform has the same query on each page, however filters is based on the tab number. (this was the easiest way of of showing lots of data)
The query runs and the query changes for each tab, however on the form loading it asks for the parameter value for the query - obviously as the query loads first before the tabbed section.
I want to put into the query sql a setting to show if the tab value is "" then just make it 1 so that the form loads without error.
I have got this far
SELECT tblproductdb.PC_Code AS Code, tblproductdb.PC_Page AS Page, tblproductdb.PC_desc AS [Desc], tblproductdb.size AS [Size], tblproductgroup.Purchasepr AS Price, tblorder1.quantity AS Quantity, [purchasepr]*[quantity] AS Total, tblproductgroup.grouping_code AS GC1, tblproductgroup.PC_group AS GC1a, tblproductgroup.[2ndgrouping] AS GC2, tblprodgroup2.Group AS GC2a
FROM (tblprodgroup2 INNER JOIN tblproductgroup ON tblprodgroup2.ID = tblproductgroup.[2ndgrouping]) INNER JOIN (tblproductdb LEFT JOIN tblorder1 ON tblproductdb.PC_Code = tblorder1.itemno) ON tblproductgroup.grouping_code = tblproductdb.grouping_code
WHERE (((tblproductgroup.[2ndgrouping])=IIf(IsNull([Form]![prodtab].[value]),1) Or (tblproductgroup.[2ndgrouping])=Nz([Form]![prodtab].[value],1)));
where form!prodtab is the subform
I dont want to put the mainform name in, as the query is used on another form.... Help please its driving me mad!!!