Forms 访问:更新具有相同编号的多个记录

Forms 访问:更新具有相同编号的多个记录,forms,ms-access,vba,auto-update,Forms,Ms Access,Vba,Auto Update,我有一个产品表,每个产品都有序列号。还有另一个字段标记为SOP 基本上,当产品销售时,SOP编号(订单号)将出现在每个序列号旁边的字段中 在我继续之前,当我说扫描,这是因为一切都是条形码 我希望能够创建一个表格,在那里我可以扫描SOP编号,然后让它向下制表,在那里我可以扫描SOP中的所有序列号 然后需要使用相关SOP编号更新每个扫描序列号 有什么想法吗?实现这一点需要采取的步骤如下 1) Create an Orders table with a field for the SOP number

我有一个产品表,每个产品都有序列号。还有另一个字段标记为SOP

基本上,当产品销售时,SOP编号(订单号)将出现在每个序列号旁边的字段中

在我继续之前,当我说扫描,这是因为一切都是条形码

我希望能够创建一个表格,在那里我可以扫描SOP编号,然后让它向下制表,在那里我可以扫描SOP中的所有序列号

然后需要使用相关SOP编号更新每个扫描序列号


有什么想法吗?

实现这一点需要采取的步骤如下

1) Create an Orders table with a field for the SOP number
2) Create an Order Details table with field for the SOP number
3) Create a form with a data source of the Orders table
4) Add a subform to the Orders form relating/linking the two forms on the SOP number
5) On the Orders form, disable "Tab Stop" for all fields except the SOP number field.
6) On the Orders form make sure that the "Enter Key Behavior" for the SOP number field     is "Default". If you don't do this, when the SOP number is canned, any subsequent scans will go into the same field.
7) On the Orders form add an "After Update" Event Procedure to
  i) Test if a value has been entered in the SOP number field
    and if so
  ii)Set focus on the SOP number on the Order Detail subform
    otherwise set focus to the SOP number field on the Orders form
8) On the Order Details subform, disable "tab Stop" for all fields except the serial number field.
9) On the Order Details subform make sure that the "Enter Key Behavior" for the serial number field is "Default".
10) Make sure the scanner is programmed to emulate an enter key press (CR/LF) after each scan, this is the default for most scanners I believe.
扫描SOP编号后,如果找到条目,焦点将转移到子表单上的序列号字段,然后可以开始扫描序列号

SOP编号字段的AfterUpdate事件示例

Private Sub OrderSopNumber_AfterUpdate()
  If Me.OrderSopNumber > "" Then
    Me.sfmOrderDetail.Form.OrderDetailSerialNumber.SetFocus
  Else
    Me.OrderSopNumber.SetFocus
  End If
End Sub

你已经做了多少?您能否将SOP扫描到表单上的文本框中?您可以将序列号扫描到另一个文本框中吗?当前的流程是使用自动标签设置组合框。序列扫描后,扫描SOP。然后是串行,然后是sop,然后是串行……等等。当一些订单有50多个序列号时,这是相当痛苦的。对,通过避免对每个相关序列号再次扫描相同的SOP,您可以将痛苦减少近50%。我是格迪特。您是否创建过包含子表单的表单?我不能说我创建过。你知道网上有什么家教吗?