pepetheshrimp1
New member
- Local time
- Today, 08:17
- Joined
- Aug 11, 2019
- Messages
- 5
Hi
If someone could help me with the following query that would be great.
I have created a form which I am using to filter a query. In the query I have created an expression shown below which works fine - giving me the value 1 if the combo box mechanismcbo is blank or has the relevant value.
Mechanisms: IIf(IsNull([Forms]![frmGameSuggestion]![mechanismcbo]) Or (Mechanism.Value)=([Forms]![frmGameSuggestion]![mechanismcbo]),1,2)
The problem is that I would like to include a second combo box so that the user can choose between two mechanisms. As soon as I try to include the second combo box in the expression I get the warning that a bracket or parantheses is missing. I have tried to resolve this for the past hour but have failed. I suspect the method I am attempting is not the most elegant solution
so any help in advising me what I need to change in the below code would be much appreciated. The code I have attempted to use is below:
Mechanisms: IIf((IsNull([Forms]![frmGameSuggestion]![mechanismcbo]) Or (Mechanism.Value)=([Forms]![frmGameSuggestion]![mechanismcbo]),1, IIf((IsNull([Forms]![frmGameSuggestion]![mechanismcbo1]) Or (Mechanism.Value)=([Forms]![frmGameSuggestion]![mechanismcbo1]),1,2)
Many thanks in advance
Sam Jones
If someone could help me with the following query that would be great.
I have created a form which I am using to filter a query. In the query I have created an expression shown below which works fine - giving me the value 1 if the combo box mechanismcbo is blank or has the relevant value.
Mechanisms: IIf(IsNull([Forms]![frmGameSuggestion]![mechanismcbo]) Or (Mechanism.Value)=([Forms]![frmGameSuggestion]![mechanismcbo]),1,2)
The problem is that I would like to include a second combo box so that the user can choose between two mechanisms. As soon as I try to include the second combo box in the expression I get the warning that a bracket or parantheses is missing. I have tried to resolve this for the past hour but have failed. I suspect the method I am attempting is not the most elegant solution
so any help in advising me what I need to change in the below code would be much appreciated. The code I have attempted to use is below:
Mechanisms: IIf((IsNull([Forms]![frmGameSuggestion]![mechanismcbo]) Or (Mechanism.Value)=([Forms]![frmGameSuggestion]![mechanismcbo]),1, IIf((IsNull([Forms]![frmGameSuggestion]![mechanismcbo1]) Or (Mechanism.Value)=([Forms]![frmGameSuggestion]![mechanismcbo1]),1,2)
Many thanks in advance
Sam Jones