参考代码
If e.IsFocusCell Then
If e.Col.Name = "物料名称" Then
If e.Row.IsNull("物料名称") Then
e.Col.Combolist = DataTables("即时库存").GetComboListString("物料名称", "[类别] = '" & e.Row("类别") & "' and [库存数量] >0")
Else
e.Col.Combolist = DataTables("项目材料").GetComboListString("物料名称", "部门 = '" & e.Row("部门") & "' and 工程项目 = '" & e.Row("工程项目") & "' And [类别] = '" & e.Row("类别") & "'")
End If
End If
End If