G
Guest
Hi
I'm using the following parameter query with a form, it works for the first
few times and then doesn't bring back any records at all. To get it working
again I need to rewrite the whole query! Whats happening?? Please help!
SELECT Details.[Customer Name], Details.[Address 1], Details.[Address 2],
Details.[Address 3], Details.City, Details.County, Details.[Post Code],
Details.[Contact Name], Details.[Mobile Number], Details.[Telephone Number],
Details.[Fax Number], Details.[Current Supplier], Details.[Current Supplier],
Details.Group, Details.[Group A/C Code], Details.Turnover, Details.[Sales
Rep], Details.[Sales Rep], Details.Asian, Details.[Price - Pint],
Details.[Price - Litre], Details.[Price - 2 Litre], Details.[Price - 2
Litre], Details.[Qty - Litre], Details.[Qty - Pint], Details.[Qty - 2
Litres], Details.Cream, Details.Bread, Details.Eggs, Details.Notes,
Details.Category, Details.[Linked to]
FROM Details
WHERE Details.category Like IIf(Forms![search Form]!category Is
Null,"*",Forms![search Form]!category) And Details.city Like
IIf(Forms![search Form]!city Is Null,"*",Forms![search Form]!city) And
Details.county Like IIf(Forms![search Form]!county Is Null,"*",Forms![search
Form]!county) And Details.[current supplier] Like IIf(Forms![search
Form]![current supplier] Is Null,"*",Forms![search Form]![current supplier])
And Details.asian Like IIf(Forms![search Form]!asian Is
Null,"*",Forms![search Form]!asian) And Details.turnover>=Forms![search
Form]!turnovergreater And Details.turnover<=Forms![search Form]!turnoverless;
I'm using the following parameter query with a form, it works for the first
few times and then doesn't bring back any records at all. To get it working
again I need to rewrite the whole query! Whats happening?? Please help!
SELECT Details.[Customer Name], Details.[Address 1], Details.[Address 2],
Details.[Address 3], Details.City, Details.County, Details.[Post Code],
Details.[Contact Name], Details.[Mobile Number], Details.[Telephone Number],
Details.[Fax Number], Details.[Current Supplier], Details.[Current Supplier],
Details.Group, Details.[Group A/C Code], Details.Turnover, Details.[Sales
Rep], Details.[Sales Rep], Details.Asian, Details.[Price - Pint],
Details.[Price - Litre], Details.[Price - 2 Litre], Details.[Price - 2
Litre], Details.[Qty - Litre], Details.[Qty - Pint], Details.[Qty - 2
Litres], Details.Cream, Details.Bread, Details.Eggs, Details.Notes,
Details.Category, Details.[Linked to]
FROM Details
WHERE Details.category Like IIf(Forms![search Form]!category Is
Null,"*",Forms![search Form]!category) And Details.city Like
IIf(Forms![search Form]!city Is Null,"*",Forms![search Form]!city) And
Details.county Like IIf(Forms![search Form]!county Is Null,"*",Forms![search
Form]!county) And Details.[current supplier] Like IIf(Forms![search
Form]![current supplier] Is Null,"*",Forms![search Form]![current supplier])
And Details.asian Like IIf(Forms![search Form]!asian Is
Null,"*",Forms![search Form]!asian) And Details.turnover>=Forms![search
Form]!turnovergreater And Details.turnover<=Forms![search Form]!turnoverless;