Private Sub Command2_Click() '库存过期药品必须清理后才能入库 Dim rq1 As String Dim rq2 As String Dim rq3 As String On Error GoTo err2 With Adodc1 .RecordSource = "select * from " & frmmain.datas & " where 编号='" & Text1.Text & "'" .Refresh If .Recordset.Fields("失效标记") = False Then If .Recordset.AbsolutePosition <> adPosUnknown Then .Recordset.Fields("规格") = Text2.Text .Recordset.Fields("单位") = Combo1.Text .Recordset.Fields("数量") = Text3.Text .Recordset.Fields("进价") = Text4.Text .Recordset.Fields("进价合计") = (Text3.Text) * (Text4.Text) .Recordset.Fields("零售价") = Text5.Text .Recordset.Fields("零售合计") = (Text3.Text) * (Text5.Text) .Recordset.Fields("产地") = Text6.Text .Recordset.Fields("批号") = Text7.Text .Recordset.Fields("差额") = (.Recordset.Fields("零售合计")) - (.Recordset.Fields("进价合计")) rq1 = Text8.Text & "-" & Text9.Text & "-" & Text10.Text .Recordset.Fields("采购日期") = CDate(rq1) rq2 = Text11.Text & "-" & Text12.Text & "-" & Text13.Text .Recordset.Fields("出厂日期") = CDate(rq2) rq3 = Text14.Text & "-" & Text15.Text & "-" & Text16.Text .Recordset.Fields("失效期") = CDate(rq3) .Recordset.Fields("备注") = Text17.Text .Recordset.UpdateBatch End If Command2.Enabled = False Text1.Enabled = True Text18.Enabled = True Label23.Caption = "" Else MsgBox "该库存药品已经失效,须清理后才能入库!" End If End With Exit Sub err2: MsgBox "登记项目填写不全或数据类型不匹配!" End Sub
Private Sub Command3_Click() frmcode.Show End Sub
Private Sub Command4_Click() Unload Me End Sub
Private Sub Form_Load() On Error GoTo err4 frminput.Top = (frmmain.Height - frminput.Height) / 2 - 500 frminput.Left = (frmmain.Width - frminput.Width) / 2 Adodc1.ConnectionString = frmlogin.conn Adodc2.ConnectionString = frmlogin.conn Adodc3.ConnectionString = frmlogin.conn Command1.Enabled = False Command2.Enabled = False Text2.Locked = True Text1.Enabled = False Text18.Enabled = False Text8.Text = "2000" Text9.Text = "01" Text10.Text = "01" Text11.Text = "2000" Text12.Text = "01" Text13.Text = "01" Text14.Text = "2000" Text15.Text = "01" Text16.Text = "01" Text17.Text = "请填写备注" Exit Sub err4: MsgBox "远程服务器连接失败!" End Sub
Private Sub Text1_Change() On Error GoTo err3 With Adodc2 .RecordSource = "select * from " & frmmain.kcode & " where 编号='" & Text1.Text & "'" .Refresh If .Recordset.AbsolutePosition <> adPosUnknown Then Text2.Text = .Recordset.Fields(3)
首页 上一页 6 7 8 9 10 11 12 下一页 尾页 9/12/12