This Expression is Typed incorrectly

Moxioron

Registered User.
Local time
Today, 12:29
Joined
Jul 11, 2012
Messages
68
Hello.

I have a query that has several queries fed into it. I have a form that I use to select the dealership from a combo box. The SQL like this works fine. No issues when I select a name from the dealership drop down.

HAVING ((([tbl_Dealership Name].[Dealership Name])=[Forms]![frm_Auto Loans - Dealer Report Card - Roll up]![Dealership]))

However, if I update the Criteria so that all of the Dealers reflect when nothing is selected, I get the 'This Expression is Typed Incorrectly.....' message.

HAVING ((([tbl_Dealership Name].[Dealership Name]) Like [Forms]![frm_Auto Loans - Dealer Report Card - Roll up]![Dealership] & "*"))

Any way around this ...? Thanks.
 
I suspect your query is structured wrongly. HAVING is essentially used to create a condition for results of aggregations, and such a result is hardly ever a string. Show the SQL.
 
I rebuilt the query and did what I have been told 1,000 times, but never seem to do .... build a little, test a little.

Thanks for responding.
 
Try the below, (it is not tested)!

HAVING ((([tbl_Dealership Name].[Dealership Name])=[Forms]![frm_Auto Loans - Dealer Report Card - Roll up]![Dealership])) OR [Forms]![frm_Auto Loans - Dealer Report Card - Roll up]![Dealership] Is Null
 

Users who are viewing this thread

Back
Top Bottom