Lilfiger19
New member
- Local time
- Today, 11:49
- Joined
- Mar 16, 2015
- Messages
- 6
Hi,
Can anyone tell me what I am doing wrong with the below SQL statement? I am writing this so that when a selection is chosen from each of the combo boxes (Name and Month/Year) then it will look back at a table and perform an average on a specific field. To achieve this, right now, I have this under the After Change Event.
With the code below, I keep getting the error message.
"The expression you entered contains invalid syntax, or you need to enclose your text data in quotes."
Please, if anyone can help me I will be greatly appreciative.
Can anyone tell me what I am doing wrong with the below SQL statement? I am writing this so that when a selection is chosen from each of the combo boxes (Name and Month/Year) then it will look back at a table and perform an average on a specific field. To achieve this, right now, I have this under the After Change Event.
With the code below, I keep getting the error message.
"The expression you entered contains invalid syntax, or you need to enclose your text data in quotes."
Code:
=IIF (((tblFIRStats.[Associate])="[cbxAssociate]"),
(Select
AVG(tblFIRStats.[FIR_Perc])
From tblFIRStats
Where ((tblFIRStats.[Associate])="[cboAssociate]"))),
(Select
AVG(tblFIRStats.[FIR_Perc])
From tblFIRStats
Where ((tblFIRStats.[Month])="[cboMonYr]")))
Please, if anyone can help me I will be greatly appreciative.