All values in subform not showing

G

Guest

I have a main form and a sub form based on it linked by SiteName.
In the subform I have two combo boxes for Supplier & ProductName. I have the
ProductName combo box based on the value in the Supplier combo box, this is
done by a query.
The correct Product values are shown when only 1 Supplier has been selected,
however, when I use 2 or more Suppliers in the subform not all the Products
are shown, they only show for the selected Supplier.
The values are updated to the table okay.
The values are in the subform but are only shown when moving from one line
to the other.
Is there a way to show all values in the subform regardles of the amount of
Suppliers used ?
 
A

Al Camp

Jamesy,
You wrote...
when I use 2 or more Suppliers in the subform not all the Products
are shown, they only show for the selected Supplier.
Do you mean... "when there are multiple subform records, each with a (1)
different supplier on each record?"

Your ProdName combo can only decide what choices to display when that
record is "Current" (your cursor is in it). It has no idea about the
Supplier on any other subform records.

**Both Supplier and ProdName should be bound fields, and... using the
AfterUpdate event of Supplier, you should Requery the ProdName combo to sync
it with that Supplier. After values are placed in Supplier and ProdName
they should always display the correct values.

An "unbound" ProdName will show the same value on all subform records...
regardless of the Supplier on each record.
 
G

Guest

Al Camp said:
Jamesy,
You wrote...
Do you mean... "when there are multiple subform records, each with a (1)
different supplier on each record?"
** Yes, record one may read Bloggs Ltd & record2 may read Smith Inc.
Your ProdName combo can only decide what choices to display when that
record is "Current" (your cursor is in it). It has no idea about the
Supplier on any other subform records.
**I am not sure what you mean, if I have say 4 Product records from the same
Supplier then I see all 4 records. This also applies if I have multiple
Products from multiple Suppliers ie I see all the Products for whatever
Supplier that has focus.
**Both Supplier and ProdName should be bound fields, and... using the
AfterUpdate event of Supplier, you should Requery the ProdName combo to sync
it with that Supplier. After values are placed in Supplier and ProdName
they should always display the correct values.
** They are both bound fileds.
** I have the AfterUpdate event of the Supplier Requery the Product.
** I have also set the Product to Requery on the Subforms OnCurrent event.
** The correct values are shown but only when the focus is on that record.
 
A

Al Camp

Jamesy,
Please don't "interlace" your responses between the lines of my response.
It is very difficult to determine what statements are yours vs. mine. Just
Top post or Bottom post.

You wrote...
** The correct values are shown but only when the focus is on that record.
What that intimates to me is that given a Supplier of "Smith & Co" and a
ProdName of "Screwdriver"... when you move off the subform record to another
subform record... those values change?

Give me some example entries for Supplier and ProdName, and tell me what
you see (exactly) that's wrong vs. what happens when you place the cursor on
the record. What do you see that's wrong when the record does not have the
focus?
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions
 

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