我在MS Access 2013中有一个表格。
输入信息后,选择零件并单击“发送”按钮,零件将被发送出去(插入表B中并从表A中删除)。
我想在零件发出之前在消息框中显示选定的记录。
是否可以?如果没有,您能为我推荐另一种方式吗?非常感谢你!
对的,这是可能的。我想数据存储在表中了吗?您可以在按钮的on click事件上使用vba,如下所示:
private sub buttonSend_onclick()
Dim rs as recordset
Dim s as string
s = "Select * from [TableName] Where [SelectFieldName] = True"
Set rs = Currentdb.openrecordset(s)
s = ""
While not rs.eof
s = s & rs("[PartIdFieldName]") & ", "
rs.movenext
wend
if s <> "" then
s = left(s,len(s) - 2)
s = s & "."
else
Msgbox "No parts selected"
end if
s = "Deliver parts below?" & vbcrlf & vbcrlf & s
if(msgbox(s,vbYesNo) = vbYes) then
''proceed with the send
else
''do not proceed with the send
end if
end sub
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句