Sigh, OK, I’ve been on before with this same issue. I’ve gone back to my post a few weeks ago to re-trace my steps to try to find the issue but can’t.
Problem: I’m opening frmBilling from a name in lstIndividualBillingName. frmBilling opens to a new record that should correspond the AccountID in lstIndividualBilling Name. I’ve used the following on the load event for frmBilling:
Me.AccountID.DefaultValue = Me.OpenArgs
The following code opens frmBilling when lstIndividualBillingName is double clicked:
DoCmd.OpenForm FormName:=”frmBilling”, _
WhereCondition:=”AccountID = ” & Me.lstIndividualBillingName
frmBilling has qryBilling as a control source.
The error message I get is “Invalid Use of Null”, with “Me.AccountID.DefaultValue = Me.OpenArgs” hightlighted.
Does the fact that the control source is a query vs the table have anything to do with the problem? The SQL for the query is:
SELECT tblDemographics.AccountID, tblDemographics.[LastName/BusinessName], [salutation] & ” ” & [firstname] & ” ” & [middleinitial] & ” ” & [lastname/businessname] & ” ” & [suffix] AS Expr1, tblAccountsReceivable.DateWorked, tblAccountsReceivable.HoursWorked, tblAccountsReceivable.LaborCharge, tblAccountsReceivable.PreDiscountCharge, tblAccountsReceivable.Discount, tblAccountsReceivable.PostDiscountCharge, tblAccountsReceivable.SalesTax, tblAccountsReceivable.PostSalesTaxCharge, tblAccountsReceivable.DatePaid, tblAccountsReceivable.AmtPaid, tblAccountsReceivable.Balence, tblAccountsReceivable.CreditAmountDue, tblAccountsReceivable.RebillAmt, tblAccountsReceivable.PaidInFull, tblAccountsReceivable.PartialPayment, tblAccountsReceivable.Rebill, tblAccountsReceivable.CreditDue, tblAccountsReceivable.PaymentSource, tblAccountsReceivable.InvoiceComments, tblDemographics.TaxExemptStatus, tblDemographics.ProspectDate, tblDemographics.ReactivateDate, tblDemographics.InactiveDate, tblDemographics.ActivationDate, tblDemographics.Active
FROM tblDemographics RIGHT JOIN tblAccountsReceivable ON tblDemographics.AccountID = tblAccountsReceivable.AccountID
ORDER BY tblDemographics.[LastName/BusinessName];
The query does allow records to be added.
Thanks,
Leesha