r = .FindRow("[出差人姓名] like '%," & s & ",%'") '如果是第一个人,或最后一个人,他们前面或后面,没有","这个字符的,这样r是找不到的。建议转成集合再找,或直接在原字符前和后加上","
dim txt as string = "," & e.form.controls("出差人姓名").text & ","
试试:
dr = .FindRow("[出差人姓名] like '%," & s & ",%' and (([出发日期] <= #" & Forms("差旅费录入").Controls("出发日期").value & " # and [返回日期] >= #" & Forms("差旅费录入").Controls("出发日期").value & "#) or
([出发日期] <= #" & Forms("差旅费录入").Controls("返回日期").value & "# and [返回日期] >= #" & Forms("差旅费录入").Controls("返回日期").value & "#))"
[此贴子已经被作者于2023/5/28 22:17:49编辑过]