listbox is blank - query issue?

C

Chace

When I had the row source of a list box set to a single table, the list box
populated just fine. However, I linked to a second table and summed the
invoice amount in the second table. I confirmed that the query returned the
proper records, but when I save and open the form, the list box is blank
(does not show any records)! Weird! Any idea what is going on here??

The select query giving me the problem is shown below:

SELECT tbl_PO.POID, tbl_PO.VendorID, Format([POcreationDate],"mm/dd/yy") AS
PODate, tbl_PO.PONumber, tbl_PO.VendorName AS VendName, tbl_PO.PODesc,
tbl_PO.QuoteAmt, Sum(tbl_Invoices.InvAmt) AS SumofInvAmt, tbl_PO.GLaccount,
tbl_PO.GLaccountDesc, tbl_PO.Equipment, tbl_PO.ReceivedBy,
tbl_PO.DeliveryStatus
FROM tbl_PO INNER JOIN tbl_Invoices ON tbl_PO.POID = tbl_Invoices.POID
GROUP BY tbl_PO.POID, tbl_PO.VendorID, Format([POcreationDate],"mm/dd/yy"),
tbl_PO.PONumber, tbl_PO.VendorName, tbl_PO.PODesc, tbl_PO.QuoteAmt,
tbl_PO.GLaccount, tbl_PO.GLaccountDesc, tbl_PO.Equipment, tbl_PO.ReceivedBy,
tbl_PO.DeliveryStatus, tbl_PO.POcreationDate
HAVING (((tbl_PO.DeliveryStatus)='Open'))
ORDER BY tbl_PO.POcreationDate DESC;
 
C

Chace

Nevermind. I found the problem.....I had code that changed the "Where"
statement of the row source of the list box via VBA code based on various
combo box selections. When I made the link to the second table and added the
Totals row, the "Where" statement changed to a "Having" statement in the row
source. Now my code was messing up the row source sql statement because it
could not find the "Where" any longer.

Anyway, problem solved.....I hope my learning can help someone else!
 

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