|
本帖最后由 todaynew 于 2011-6-24 10:48 编辑
紫风 发表于 2011-6-24 10:31
这个……
版主,NZ没用过,请问能不能具体点?谢谢!!
STemp = "SELECT [tbl入库].* FROM [tbl入库] WHERE 入库ID = '" & nz(Me.入库号,"") & "'"
其实不必大费周章,直接用Dlookup就可以了。比如:
Me.卸车单号.value = nz(Dlookup("卸车单号","tbl入库","入库ID=" & nz(me.入库号.value,0)),"")
Me.日期.value = nz(Dlookup("日期","tbl入库","入库ID=" & nz(me.入库号.value,0)),"")
Me.客户名称.value = nz(Dlookup("公司名称","tbl入库","入库ID=" & nz(me.入库号.value,0)),"")
Me.工作号.value = nz(Dlookup("工作号","tbl入库","入库ID=" & nz(me.入库号.value,0)),"")
Me.入库车牌.value = nz(Dlookup("车牌号码","tbl入库","入库ID=" & nz(me.入库号.value,0)),"")
Me.入库柜号.value = nz(Dlookup("入库柜号","tbl入库","入库ID=" & nz(me.入库号.value,0)),"")
Me.入库操作.value = nz(Dlookup("操作人","tbl入库","入库ID=" & nz(me.入库号.value,0)),"")
Me.预到数.value = nz(Dlookup("预到数","tbl卸货派工","入库ID=" & nz(me.入库号.value,0)),"")
Me.实到数.value = nz(Dlookup("实到数","tbl卸货派工","入库ID=" & nz(me.入库号.value,0)),"")
Me.主班.value = nz(Dlookup("主班","tbl卸货派工","入库ID=" & nz(me.入库号.value,0)),"")
Me.副班.value = nz(Dlookup("副班","tbl卸货派工","入库ID=" & nz(me.入库号.value,0)),"")
Me.下单时间.value = nz(Dlookup("下单时间","tbl卸货派工","入库ID=" & nz(me.入库号.value,0)),"")
Me.完工时间.value = nz(Dlookup("完工时间","tbl卸货派工","入库ID=" & nz(me.入库号.value,0)),"")
|
|