Data not displaying in a subform

S

Stu

I have a general product form which allows users to get more detailed
information by double-clicking on a product name. This then opens up
the product details form which also has a subform showing outstanding
orders for that product. The data source for the subform is based on
a query looking at the product code on the main form -

SELECT * FROM tblProductOrders WHERE
(((tblProductOrders.LisecProductCode)=Forms!frmProductDetails!
LisecProductCode) And ((tblProductOrders.Received)=False));

However the subform doesn't display any data. I've tried putting
me.refresh or me.requery in both the form load and open events for the
subform and also a requery of the subform in the on load event of the
main form but this doesn't seem to have any effect.

If I have the form open and run the query it returns data and if I
have the form open ad open the subform separately it is populated with
the correct data. I'm obviously missing something but don't know what.
Any tips would be greatly appreciated.

TIA
Stu
 
G

Golfinray

Do you have the subform linked to the mainform? It must be linked on
somehting in common to both forms like an id.
 
S

Stu

Do you have the subform linked to the mainform? It must be linked on
somehting in common to both forms like an id.









- Show quoted text -

Thanks. Knew it would be something simple. The linked fields were
both set to autonumber fields instead of the product ID.
 

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