Combo box problem

G

Guest

I am trying to create an order form (similar to in the northwind example) but
where you select the catagory, this then only shows the products for that
catagory and then fills in the rest of the product details. But at the moment
it doesn't work.

As in the northwind one my orders stuff is in a form (frmSaord) and the
subform (OrderDetailssubform) is for the products.

The record source for the subform is a query (again like Northwind) with
order details eg discount and quantity.

The rowsource for the catagory is
SELECT [tblCata].[CatagoryID], [tblCata].[CatagoryName] FROM tblCata;

The rowsource for the product is
SELECT DISTINCTROW [tblPro].[Product], [tblPro].[ProductID] FROM tblPro
WHERE ((([tblPro].[CatagoryID])=[Forms]![OrderDetailssubform]![CatagoryID]))
ORDER BY [tblPro].[Product];

When I open the subform on its own everything does work in that selecting
the catagory then shows only the products from that catagory. However when I
open the main order form and try to use the subform I get Enter Parameter
Value =Forms!OrderDetailssubform!CatagoryID.

The subform also no longer brings up the unit price associated with the
product any more. It initially did but I've obviously changed something to
mess this up.

I'm not entirely sure which problem to start with first so any help would be
appreciated.
 
G

Guest

Hi, Clare.

Subform controls must be accessed using the Form property of the subform
(which is itself a control on the main form).

[Forms]![OrderDetailssubform] refers to the subform itself. The following
refers to the CatagoryID (sic):

[Forms]![OrderDetailssubform].Form![CatagoryID]

Hope that helps.
Sprinks
 
G

Guest

Sprinks you're a star, all sorted now.

I'd like to blame the typo on using british not american english but I guess
I'm just a a bad speller!

Cheers,
Clare
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top