msgbox()函数是无法在SetLabel()里正确执行的,前者是弹出窗口提示,后者是设置标签显示内容,所以你应该改一下你的公式,将msgbox去掉,直接显示内容即可。
Setlabel("",if(text([%开始日期%])>"" Or text([%结束日期%])>"" Or [%机型%]>"" and [%区域%]>"" Or [%维修部位%]>"" Or [%维修部位子类%]>"",if([%班次%]>"",countfor("设备维修数据", "日期",">=",[%开始日期%] , "日期","<=",[%结束日期%],"班次","=",[%班次%],"机号","=",[%机号%],"机型","=",[%机型%],"区域","=",[%区域%],"维修部位","=",[%维修部位%],"维修部位子类","=",[%维修部位子类%]),countfor("设备维修数据", "日期",">=",[%开始日期%] , "日期","<=",[%结束日期%],"机号","=",[%机号%],"机型","=",[%机型%],"区域","=",[%区域%],"维修部位","=",[%维修部位%],"维修部位子类","=",[%维修部位子类%])),"无法完成统计!请填写必要的数据!"))