For i = 1 To 150
'insert into 条码表(条码,批次) values('A000001','JJJ1-1')
CurrentDb.Execute ("insert into 条码表(条码,批次) values('A" &Right(CStr(1000000 + i), 6) &"','JJJ1-1')")
Next
End Sub
光标定位到“在条码表中插入150条记录()”,按F5执行这个过程。
前提:窗体的 允许编辑、允许添加 属性设为 是Private Sub 保存_Click()
'检查录入完整性
If Me.文本框1 = "" Or Me.文本框2 = "" Or Or Me.文本框3 = "" Or Me.文本框4 = "" Or Me.文本框5 = "" Or Me.文本框6 = "" Or Me.文本框7 = "" Or Me.文本框8 = "" Or Me.文本框9 = "" Or Me.文本框10 = "" Or Me.文本框11 = "" Or Me.文本框12 = "" Or Me.文本框13 = "" Or Me.文本框14 = "" Or Me.文本框15 = "" Or Me.文本框16= "" Then
MsgBox "记录录入未完整!", vbInformation, "提示:"
Exit Sub
Else
DoCmd.RunCommand acCmdSelectRecord
'将字段 备注 的内容 设置为:
me.备注 = me.文本框1 &" m至 " &me.文本框2 &" m收卷单偏差< " &me.文本框3 &" m " '&……以后内容省略
'保存记录
DoCmd.RunCommand acCmdSaveRecord
End if
End Sub
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)