View Full Version : Crosstab #Name? Problem


razorking
01-20-2006, 10:36 AM
OK, been awhile since I posted anything here. I have a weird one, hope there is a solution.

I have a form that uses a crosstab query for it's data. The problem is the crosstab query has a column heading that (in my example) represents warehouses of which there are ten. So when the form was originally created it had ten text boxes for quantity values by product for each warehouse. The problem is depending on when the query is ran there will be times when there are no values for one or more warehouses, when this happens the crosstab query does not show those warehouses at all as column headings, therefore the text boxes on the form do not have a corresponding field on the query and, because of that it displays the - #Name? in the text box.:mad:

How would one go about dealing with this situation??

Thanks!

Jon K
01-20-2006, 05:00 PM
You can add an IN clause to force the crosstab query to display all the warehouses.

TRANSFORM ...........
SELECT .............
FROM [tableName]
GROUP BY ............
PIVOT ........... IN ("warehouse1","warehouse2",.....,"warehouse10");
.

razorking
01-20-2006, 07:15 PM
Ah, it appears you are correct.

You are a genius my friend.

Thank You!