我试图让一个字段在Access 2007中有一个不同的字段有特定文本时放入某个名称。例如。
If [FieldName] = "mountain" then [FieldName2] ="Jack" but if [FieldName] = "ocean" then [FieldName2] ="John"
我找不到能给我这个结果的表达式。
答案 0 :(得分:1)
最好将多个if-then
语句更改为case / switch语句。
Select Case [Product Category]
Case "Children"
[Category Manager] = "John"
Case "Hybrid"
[Category Manager] = "Jack"
Case "Leisure"
[Category Manager] = "Sally"
Case "Mtn."
[Category Manager] = "Kelly"
Case Else
[Category Manager] = "Carl"
End Select