Link to home
Start Free TrialLog in
Avatar of bill201
bill201

asked on

problem by using runsql in access 2010

i have a code that have to run a query and check if in the qury value is higher then 1 one and if is truh that i have to get an message and there is my code:
<Dim b
b = DoCmd.RunSQL("SELECT Count(InvoiceT.Price) AS CountOfPrice " & _
                    "FROM InvoiceT " & _
                    "GROUP BY InvoiceT.Product " & _
                    "HAVING Product =" & Me.ListProducts.Column(1))
If b > 1 Then MsgBox "There is not matching pricse">


but i get an error message that point on the "runsql" :Compile error:
Expected Function or variable
ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial