Empty Subform

J

Jim Sloan

Happy 4th;

Running Access XP and Windows XP

I have a form with a combo box that looks up account numbers. This works
fine.

The subform is based on a query. The query looks at the cmbo for the
criteria "[Forms]![frmSellShares]![cmbAccts] to retrieve the appropriate
records. If I run the query from the db window with a valid selection in
the combo box the query returns the appropriate records.

The query is:

SELECT Accounts.AcctID, CoNames.ID, CoNames.StockSym, Sum(Trades.Shares) AS
SumOfShares, Sum([Shares]*[PricePaid]) AS Invest, CoNames.MutualFnd
FROM Accounts RIGHT JOIN (CoNames RIGHT JOIN Trades ON CoNames.ID =
Trades.CoNamePntr) ON Accounts.AcctID = Trades.AccntPntr
WHERE (((Accounts.AcctID)=[Forms]![frmSellShares]![cmbAccts]))
GROUP BY Accounts.AcctID, CoNames.ID, CoNames.StockSym, CoNames.MutualFnd;

The after update event of the combo is :
sfrmShareSale.Requery
sfrmShareSale.Visible = True

The main and subform are linked by the account_id.

The subform is empty when valid accounts are selected.

Any ideas?
 
G

Graham Mandeno

Hi Jim

I'm not sure what is causing this, but I do know that you are doing the same
job twice. You don't need to provide a master/child link *and* a selection
criterion for your subform. I suggest you remove the criterion from your
query (which means you can also remove the Requery statement) and see if
matters improve.

--
Good Luck!
Graham Mandeno [Access MVP]
Auckland, New Zealand

Return mail address is invalid in a vain attempt to reduce spam.
Feedback is welcome at: (e-mail address removed)
Please post new questions or followups to newsgroup.
 

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