I have looked all over and seen hundreds of questions about this command, but no answers. It seems like the most basic thing you can do with combo boxes, so I'm baffled that it doesn't work.
Here is my VBA Code:
Option Compare Database
Private Sub cboFundNumbers_AfterUpdate()
Const strFormName As String = "Fund Number 2"
Const strWhereClause As String = "A.Fundno='7225'"
DoCmd.OpenReport strFormName, acPreview, , strWhereClause
Private Sub cboFundNumbers_BeforeUpdate(Cancel As Integer)
And here is the SQL Code that the Form depends on:
SELECT B.Owner, Sum(B.AvLand) AS SumOfAvLand, Sum(B.AvImpv) AS SumOfAvImpv, Sum(A.TaxAmt1) AS SumOfTaxAmt1, Sum(A.TaxAmt2) AS SumOfTaxAmt2, Sum(A.Unpaid1) AS SumOfUnpaid1, Count(A.Napn) AS CountOfNapn
FROM [Solano Delinquency 2009] AS A, [Solano Roll 2008] AS B
WHERE A.Napn=B.Napn AND A.Fundno="7225"
GROUP BY B.Owner;
I have tried several different ways of doing this: deleting the WHERE clause from the SQL code (doesn't work), taking the where clause out of the VBA code (does work), leaving both in like shown (doesn't work), using only one condition (doesn't work). I eventually want to take the data in from the combo box, but I can't even select records with VBA yet.
Any ideas on what might be wrong?
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!