caoqi.frm
资源名称:yf.rar [点击查看]
上传用户:laihaixin
上传日期:2013-01-26
资源大小:1169k
文件大小:30k
源码类别:
医药行业
开发平台:
Visual Basic
- VERSION 5.00
- Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
- Begin VB.Form frmcaoqi
- BorderStyle = 3 'Fixed Dialog
- Caption = "其它库存品调拨"
- ClientHeight = 3675
- ClientLeft = 45
- ClientTop = 330
- ClientWidth = 7800
- DrawStyle = 1 'Dash
- Icon = "caoqi.frx":0000
- LinkTopic = "Form1"
- LockControls = -1 'True
- MaxButton = 0 'False
- MDIChild = -1 'True
- MinButton = 0 'False
- Picture = "caoqi.frx":030A
- ScaleHeight = 3675
- ScaleWidth = 7800
- ShowInTaskbar = 0 'False
- Begin VB.ComboBox Combo1
- ForeColor = &H00000000&
- Height = 300
- ItemData = "caoqi.frx":59F9
- Left = 1560
- List = "caoqi.frx":5A03
- TabIndex = 44
- Top = 3200
- Width = 1335
- End
- Begin MSAdodcLib.Adodc Adodc2
- Height = 330
- Left = 3720
- Top = 3000
- Visible = 0 'False
- Width = 1200
- _ExtentX = 2117
- _ExtentY = 582
- ConnectMode = 0
- CursorLocation = 3
- IsolationLevel = -1
- ConnectionTimeout= 15
- CommandTimeout = 30
- CursorType = 3
- LockType = 3
- CommandType = 8
- CursorOptions = 0
- CacheSize = 50
- MaxRecords = 0
- BOFAction = 0
- EOFAction = 0
- ConnectStringType= 1
- Appearance = 1
- BackColor = -2147483643
- ForeColor = -2147483640
- Orientation = 0
- Enabled = -1
- Connect = ""
- OLEDBString = ""
- OLEDBFile = ""
- DataSourceName = ""
- OtherAttributes = ""
- UserName = ""
- Password = ""
- RecordSource = ""
- Caption = "Adodc2"
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "宋体"
- Size = 9
- Charset = 134
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- _Version = 393216
- End
- Begin VB.TextBox Text10
- ForeColor = &H000000FF&
- Height = 300
- Left = 1080
- TabIndex = 43
- Top = 240
- Width = 1300
- End
- Begin VB.CommandButton Command1
- Caption = "登记&(N)"
- Height = 350
- Left = 5160
- TabIndex = 39
- Top = 3180
- Width = 1100
- End
- Begin VB.CommandButton Command3
- Caption = "关闭&(Q)"
- Height = 350
- Left = 6480
- TabIndex = 38
- Top = 3180
- Width = 1100
- End
- Begin VB.PictureBox Picture1
- Height = 600
- Left = 240
- Picture = "caoqi.frx":5A1D
- ScaleHeight = 540
- ScaleWidth = 7275
- TabIndex = 26
- Top = 2430
- Width = 7335
- Begin VB.TextBox Text5
- Alignment = 1 'Right Justify
- BackColor = &H00FFFFFF&
- ForeColor = &H000000FF&
- Height = 270
- Left = 6240
- MaxLength = 10
- TabIndex = 31
- Top = 120
- Width = 800
- End
- Begin VB.TextBox Text4
- Alignment = 1 'Right Justify
- BackColor = &H00FFFFFF&
- ForeColor = &H000000FF&
- Height = 270
- Left = 4560
- MaxLength = 2
- TabIndex = 30
- Top = 120
- Width = 400
- End
- Begin VB.TextBox Text3
- Alignment = 1 'Right Justify
- BackColor = &H00FFFFFF&
- ForeColor = &H000000FF&
- Height = 270
- Left = 3840
- MaxLength = 2
- TabIndex = 29
- Top = 120
- Width = 400
- End
- Begin VB.TextBox Text2
- Alignment = 1 'Right Justify
- BackColor = &H00FFFFFF&
- ForeColor = &H000000FF&
- Height = 270
- Left = 3000
- MaxLength = 4
- TabIndex = 28
- Top = 120
- Width = 500
- End
- Begin VB.TextBox Text1
- Alignment = 1 'Right Justify
- BackColor = &H00FFFFFF&
- ForeColor = &H000000FF&
- Height = 270
- Left = 1000
- TabIndex = 27
- Top = 120
- Width = 800
- End
- Begin VB.Label Label6
- AutoSize = -1 'True
- BackColor = &H00404040&
- BackStyle = 0 'Transparent
- Caption = "日"
- ForeColor = &H00000000&
- Height = 180
- Left = 5025
- TabIndex = 37
- Top = 165
- Width = 180
- End
- Begin VB.Label Label5
- AutoSize = -1 'True
- BackColor = &H00404040&
- BackStyle = 0 'Transparent
- Caption = "月"
- ForeColor = &H00000000&
- Height = 180
- Left = 4320
- TabIndex = 36
- Top = 165
- Width = 180
- End
- Begin VB.Label Label4
- AutoSize = -1 'True
- BackColor = &H00404040&
- BackStyle = 0 'Transparent
- Caption = "年"
- ForeColor = &H00000000&
- Height = 180
- Left = 3570
- TabIndex = 35
- Top = 165
- Width = 180
- End
- Begin VB.Label Label3
- AutoSize = -1 'True
- BackColor = &H00404040&
- BackStyle = 0 'Transparent
- Caption = "调拨人"
- ForeColor = &H00000000&
- Height = 180
- Left = 5640
- TabIndex = 34
- Top = 165
- Width = 540
- End
- Begin VB.Label Label2
- AutoSize = -1 'True
- BackColor = &H00404040&
- BackStyle = 0 'Transparent
- Caption = "调拨日期"
- ForeColor = &H00000000&
- Height = 180
- Left = 2160
- TabIndex = 33
- Top = 165
- Width = 720
- End
- Begin VB.Label Label1
- AutoSize = -1 'True
- BackColor = &H00404040&
- BackStyle = 0 'Transparent
- Caption = "调出数量"
- ForeColor = &H00000000&
- Height = 180
- Left = 240
- TabIndex = 32
- Top = 165
- Width = 720
- End
- End
- Begin VB.PictureBox Picture2
- Height = 1695
- Left = 240
- Picture = "caoqi.frx":B10C
- ScaleHeight = 1635
- ScaleWidth = 7275
- TabIndex = 1
- Top = 630
- Width = 7335
- Begin VB.TextBox Text6
- Alignment = 1 'Right Justify
- BackColor = &H00FFFFFF&
- ForeColor = &H000000FF&
- Height = 270
- Index = 2
- Left = 4320
- Locked = -1 'True
- TabIndex = 12
- Top = 480
- Width = 1000
- End
- Begin VB.TextBox Text6
- Alignment = 1 'Right Justify
- BackColor = &H00FFFFFF&
- ForeColor = &H000000FF&
- Height = 270
- Index = 3
- Left = 6000
- Locked = -1 'True
- TabIndex = 11
- Top = 480
- Width = 1000
- End
- Begin VB.TextBox Text6
- Alignment = 1 'Right Justify
- BackColor = &H00FFFFFF&
- ForeColor = &H000000FF&
- Height = 270
- Index = 4
- Left = 840
- Locked = -1 'True
- TabIndex = 10
- Top = 840
- Width = 1000
- End
- Begin VB.TextBox Text6
- Alignment = 1 'Right Justify
- BackColor = &H00FFFFFF&
- ForeColor = &H000000FF&
- Height = 270
- Index = 5
- Left = 2640
- Locked = -1 'True
- TabIndex = 9
- Top = 840
- Width = 1000
- End
- Begin VB.TextBox Text6
- Alignment = 1 'Right Justify
- BackColor = &H00FFFFFF&
- ForeColor = &H000000FF&
- Height = 270
- Index = 7
- Left = 840
- Locked = -1 'True
- TabIndex = 8
- Top = 1200
- Width = 1000
- End
- Begin VB.TextBox Text6
- Alignment = 1 'Right Justify
- BackColor = &H00FFFFFF&
- ForeColor = &H000000FF&
- Height = 270
- Index = 8
- Left = 4320
- Locked = -1 'True
- TabIndex = 7
- Top = 1200
- Width = 600
- End
- Begin VB.TextBox Text6
- Alignment = 1 'Right Justify
- BackColor = &H00FFFFFF&
- ForeColor = &H000000FF&
- Height = 270
- Index = 9
- Left = 5280
- Locked = -1 'True
- TabIndex = 6
- Top = 1200
- Width = 400
- End
- Begin VB.TextBox Text6
- Alignment = 1 'Right Justify
- BackColor = &H00FFFFFF&
- ForeColor = &H000000FF&
- Height = 270
- Index = 10
- Left = 6000
- Locked = -1 'True
- TabIndex = 5
- Top = 1200
- Width = 400
- End
- Begin VB.TextBox Text6
- Alignment = 1 'Right Justify
- BackColor = &H00FFFFFF&
- ForeColor = &H000000FF&
- Height = 270
- Index = 6
- Left = 4320
- Locked = -1 'True
- TabIndex = 4
- Top = 840
- Width = 2685
- End
- Begin VB.TextBox Text7
- Alignment = 1 'Right Justify
- BackColor = &H00FFFFFF&
- ForeColor = &H000000FF&
- Height = 270
- Left = 840
- TabIndex = 3
- Top = 480
- Width = 1000
- End
- Begin VB.TextBox Text8
- Alignment = 1 'Right Justify
- BackColor = &H00FFFFFF&
- ForeColor = &H000000FF&
- Height = 270
- Left = 2640
- Locked = -1 'True
- TabIndex = 2
- Top = 480
- Width = 1000
- End
- Begin MSAdodcLib.Adodc Adodc5
- Height = 330
- Left = 6000
- Top = 50
- Visible = 0 'False
- Width = 1200
- _ExtentX = 2117
- _ExtentY = 582
- ConnectMode = 0
- CursorLocation = 3
- IsolationLevel = -1
- ConnectionTimeout= 15
- CommandTimeout = 30
- CursorType = 3
- LockType = 3
- CommandType = 8
- CursorOptions = 0
- CacheSize = 50
- MaxRecords = 0
- BOFAction = 0
- EOFAction = 0
- ConnectStringType= 1
- Appearance = 1
- BackColor = -2147483643
- ForeColor = -2147483640
- Orientation = 0
- Enabled = -1
- Connect = ""
- OLEDBString = ""
- OLEDBFile = ""
- DataSourceName = ""
- OtherAttributes = ""
- UserName = ""
- Password = ""
- RecordSource = ""
- Caption = "Adodc5"
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "宋体"
- Size = 9
- Charset = 134
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- _Version = 393216
- End
- Begin MSAdodcLib.Adodc Adodc4
- Height = 330
- Left = 4680
- Top = 50
- Visible = 0 'False
- Width = 1200
- _ExtentX = 2117
- _ExtentY = 582
- ConnectMode = 0
- CursorLocation = 3
- IsolationLevel = -1
- ConnectionTimeout= 15
- CommandTimeout = 30
- CursorType = 3
- LockType = 3
- CommandType = 8
- CursorOptions = 0
- CacheSize = 50
- MaxRecords = 0
- BOFAction = 0
- EOFAction = 0
- ConnectStringType= 1
- Appearance = 1
- BackColor = -2147483643
- ForeColor = -2147483640
- Orientation = 0
- Enabled = -1
- Connect = ""
- OLEDBString = ""
- OLEDBFile = ""
- DataSourceName = ""
- OtherAttributes = ""
- UserName = ""
- Password = ""
- RecordSource = ""
- Caption = "Adodc4"
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "宋体"
- Size = 9
- Charset = 134
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- _Version = 393216
- End
- Begin VB.Label Label7
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "编 号"
- Height = 180
- Index = 1
- Left = 240
- TabIndex = 25
- Top = 525
- Width = 540
- End
- Begin VB.Label Label7
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "名 称"
- Height = 180
- Index = 2
- Left = 2040
- TabIndex = 24
- Top = 530
- Width = 540
- End
- Begin VB.Label Label7
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "规格"
- Height = 180
- Index = 3
- Left = 3880
- TabIndex = 23
- Top = 530
- Width = 360
- End
- Begin VB.Label Label7
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "单位"
- Height = 180
- Index = 4
- Left = 5570
- TabIndex = 22
- Top = 525
- Width = 360
- End
- Begin VB.Label Label7
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "数 量"
- Height = 180
- Index = 5
- Left = 240
- TabIndex = 21
- Top = 885
- Width = 540
- End
- Begin VB.Label Label7
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "零售价"
- Height = 180
- Index = 6
- Left = 2040
- TabIndex = 20
- Top = 890
- Width = 540
- End
- Begin VB.Label Label7
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "产地"
- Height = 180
- Index = 7
- Left = 3880
- TabIndex = 19
- Top = 890
- Width = 360
- End
- Begin VB.Label Label7
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "批 号"
- Height = 180
- Index = 8
- Left = 240
- TabIndex = 18
- Top = 1245
- Width = 540
- End
- Begin VB.Label Label7
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "失效期"
- Height = 180
- Index = 9
- Left = 3720
- TabIndex = 17
- Top = 1245
- Width = 540
- End
- Begin VB.Label Label7
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "请输入调拨药品编号"
- ForeColor = &H00000000&
- Height = 180
- Index = 0
- Left = 240
- TabIndex = 16
- Top = 120
- Width = 1620
- End
- Begin VB.Label Label8
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "年"
- Height = 180
- Left = 5025
- TabIndex = 15
- Top = 1245
- Width = 180
- End
- Begin VB.Label Label9
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "月"
- Height = 180
- Left = 5745
- TabIndex = 14
- Top = 1245
- Width = 180
- End
- Begin VB.Label Label10
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "日"
- Height = 180
- Left = 6435
- TabIndex = 13
- Top = 1245
- Width = 180
- End
- End
- Begin VB.TextBox Text9
- BackColor = &H00FFFFFF&
- ForeColor = &H000000FF&
- Height = 300
- Left = 3960
- TabIndex = 0
- Top = 240
- Width = 3615
- End
- Begin MSAdodcLib.Adodc Adodc1
- Height = 330
- Left = 3720
- Top = 3360
- Visible = 0 'False
- Width = 1215
- _ExtentX = 2143
- _ExtentY = 582
- ConnectMode = 0
- CursorLocation = 3
- IsolationLevel = -1
- ConnectionTimeout= 15
- CommandTimeout = 30
- CursorType = 3
- LockType = 3
- CommandType = 8
- CursorOptions = 0
- CacheSize = 50
- MaxRecords = 0
- BOFAction = 0
- EOFAction = 0
- ConnectStringType= 1
- Appearance = 1
- BackColor = -2147483643
- ForeColor = -2147483640
- Orientation = 0
- Enabled = -1
- Connect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:himshis.mdb;Persist Security Info=False"
- OLEDBString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:himshis.mdb;Persist Security Info=False"
- OLEDBFile = ""
- DataSourceName = ""
- OtherAttributes = ""
- UserName = ""
- Password = ""
- RecordSource = "select * from ypdb order by ID"
- Caption = "Adodc1"
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "宋体"
- Size = 9
- Charset = 134
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- _Version = 393216
- End
- Begin VB.Label Label11
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "调拨部门"
- Height = 180
- Left = 240
- TabIndex = 42
- Top = 300
- Width = 720
- End
- Begin VB.Label Label12
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "调拨备注"
- ForeColor = &H00000000&
- Height = 180
- Left = 3120
- TabIndex = 41
- Top = 300
- Width = 720
- End
- Begin VB.Label result
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "选择调拨数据库"
- ForeColor = &H00000000&
- Height = 180
- Left = 240
- TabIndex = 40
- Top = 3250
- Width = 1260
- End
- End
- Attribute VB_Name = "frmcaoqi"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Public jiage As Currency
- Public shulian As Integer
- Public drq3 As String
- Public drq4 As String
- Public Sub dbdj()
- On Error GoTo err1
- With Adodc1
- .RecordSource = "select * from " & frmmain.datas & " where 编号='" & Text7.Text & "'"
- .Refresh
- If .Recordset.Fields("失效标记") = False Then
- shuliang = Str(Text6(4).Text) - Str(Text1.Text)
- .Recordset.Fields("数量") = shuliang
- .Recordset.Fields("零售合计") = .Recordset.Fields("零售价") * shuliang
- .Recordset.Fields("进价合计") = .Recordset.Fields("进价") * shuliang
- .Recordset.Fields("差额") = .Recordset.Fields("零售合计") - .Recordset.Fields("进价合计")
- .Recordset.Update
- With Adodc4
- .RecordSource = "select * from ypdb order by ID"
- .Refresh
- .Recordset.AddNew
- .Recordset.Fields("编号") = Text7.Text
- .Recordset.Fields("名称") = Text8.Text
- .Recordset.Fields("规格") = Text6(2).Text
- .Recordset.Fields("单位") = Text6(3).Text
- .Recordset.Fields("数量") = Text1.Text
- .Recordset.Fields("零售价") = Text6(5).Text
- .Recordset.Fields("进价") = jiage
- .Recordset.Fields("产地") = Text6(6).Text
- .Recordset.Fields("批号") = Text6(7).Text
- .Recordset.Fields("调拨部门") = Text10.Text
- drq3 = Text6(8).Text & "-" & Text6(9).Text & "-" & Text6(10).Text
- .Recordset.Fields("失效期") = CDate(rq3)
- .Recordset.Fields("调拨人") = Text5.Text
- drq4 = Text2.Text & "-" & Text3.Text & "-" & Text4.Text
- .Recordset.Fields("调拨日期") = CDate(rq4)
- .Recordset.Fields("备注") = Text9.Text
- .Recordset.Update
- End With
- Else
- MsgBox "该产品已经失效,不能调拨!"
- End If
- End With
- Command1.Enabled = False
- Exit Sub
- err1:
- MsgBox "当前数据库更新失败,药品或器械尚未出库!"
- End Sub
- Private Sub Combo1_Click()
- If Combo1.Text = "器械材料库" Then
- frmmain.datas = "qixie"
- frmcaoqi.Caption = "器械材料调拨登记"
- Text7.Enabled = True
- With Adodc1
- .RecordSource = "select * from " & frmmain.datas & " where 失效标记=false"
- .Refresh
- For i = 0 To .Recordset.RecordCount
- If Not .Recordset.EOF Then
- If .Recordset.Fields("失效期") <= Date Then
- .Recordset.Fields("失效标记") = True
- .Recordset.Update
- Else
- .Recordset.Fields("失效标记") = False
- .Recordset.Update
- End If
- .Recordset.MoveNext
- End If
- Next
- End With
- End If
- If Combo1.Text = "中草药库" Then
- frmmain.datas = "caoyao"
- frmcaoqi.Caption = "中草药调拨登记"
- Text7.Enabled = True
- With Adodc1
- .RecordSource = "select * from " & frmmain.datas & " where 失效标记=false"
- .Refresh
- For i = 0 To .Recordset.RecordCount
- If Not .Recordset.EOF Then
- If .Recordset.Fields("失效期") <= Date Then
- .Recordset.Fields("失效标记") = True
- .Recordset.Update
- Else
- .Recordset.Fields("失效标记") = False
- .Recordset.Update
- End If
- .Recordset.MoveNext
- End If
- Next
- End With
- End If
- If Combo1.Text <> "器械材料库" And Combo1.Text <> "中草药库" Then
- Command1.Enabled = False
- Text7.Enabled = False
- frmcaoqi.Caption = "其它库存品调拨"
- End If
- End Sub
- Private Sub Command1_Click()
- '过滤失效药品器械
- On Error GoTo err2
- If Text10.Text <> "" Then
- If Str(Text1.Text) <= Str(Text6(4).Text) Then
- Text9.Text = Text6(4).Text
- If Text1.Text = 0 Or Text2.Text = "" Or Text5.Text = "" Then
- MsgBox "调拨数量不能为零,调拨日期和调拨人必须填写!"
- Else
- Call dbdj
- End If
- Else
- Text9.Text = Text1.Text & Text6(4).Text
- MsgBox "调出量大于库存量!当前库存量为:" & Text6(4).Text & Text6(3).Text
- Command1.Enabled = False
- End If
- Else
- MsgBox "调拨部门必须填写!"
- End If
- Exit Sub
- err2:
- MsgBox "数据类型不匹配或库存数据出错!"
- End Sub
- Private Sub Command3_Click()
- Unload Me
- End Sub
- Private Sub Form_Load()
- On Error GoTo err3
- frmcaoqi.Top = (frmmain.Height - frmcaoqi.Height) / 2 - 500
- frmcaoqi.Left = (frmmain.Width - frmcaoqi.Width) / 2
- Adodc1.ConnectionString = frmlogin.conn
- Adodc2.ConnectionString = frmlogin.conn
- Adodc4.ConnectionString = frmlogin.conn
- Adodc5.ConnectionString = frmlogin.conn
- Command1.Enabled = False
- Text2.Text = Year(Date)
- Text3.Text = Month(Date)
- Text4.Text = Day(Date)
- Text9.Text = "无"
- Text1.Text = 0
- Text7.Enabled = False
- Exit Sub
- err3:
- MsgBox "数据库连接失败!"
- End Sub
- Private Sub Text10_Change()
- On Error GoTo err4
- Text5.Text = ""
- With Adodc2
- .RecordSource = "select 科室名称,代码 from kscode where 代码='" & Text10.Text & "'"
- .Refresh
- If .Recordset.AbsolutePosition <> adPosUnknown Then
- Text10.Text = .Recordset.Fields("科室名称")
- End If
- End With
- Exit Sub
- err4:
- MsgBox "数据库连接失败!"
- End Sub
- Private Sub Text7_Change()
- '库存为零时不能调拨药品
- On Error GoTo err4
- With Adodc1
- .RecordSource = "select * from " & frmmain.datas & " where 编号='" & Text7.Text & "' and 失效标记=false"
- .Refresh
- If .Recordset.AbsolutePosition <> adPosUnknown Then
- Text8.Text = .Recordset.Fields("名称")
- Text6(2).Text = .Recordset.Fields("规格")
- Text6(3).Text = .Recordset.Fields("单位")
- Text6(4).Text = .Recordset.Fields("数量")
- jiage = .Recordset.Fields("进价")
- Text6(5).Text = .Recordset.Fields("零售价")
- Text6(6).Text = .Recordset.Fields("产地")
- Text6(7).Text = .Recordset.Fields("批号")
- Text6(8).Text = Year(.Recordset.Fields("失效期"))
- Text6(9).Text = Month(.Recordset.Fields("失效期"))
- Text6(10).Text = Day(.Recordset.Fields("失效期"))
- Command1.Enabled = True
- Label7(0).Caption = ""
- If Text6(4).Text = 0 Then
- MsgBox "该产品库存已空,不能调拨!"
- Text1.Text = ""
- Command1.Enabled = False
- Else
- Command1.Enabled = True
- End If
- Else
- Label7(0).Caption = "提示:没有编号为“" & Text7.Text & "”的药品或器械或已失效!"
- Command1.Enabled = False
- Text8.Text = ""
- For i = 2 To 10
- Text6(i) = ""
- Next
- End If
- End With
- Exit Sub
- err4:
- MsgBox "原始数据有错或数据库连接失败!"
- End Sub
- Private Sub Form_Unload(Cancel As Integer)
- frmmain.StatusBar1.Panels(2) = "目前没有窗口被激活"
- End Sub
- Private Sub Form_Activate()
- frmmain.StatusBar1.Panels(2) = "活动窗口:" & frmcaoqi.Caption
- End Sub
- Private Sub Text1_GotFocus()
- Text1.SelStart = 0
- Text1.SelLength = Len(Text1.Text)
- End Sub
- Private Sub Text7_GotFocus()
- Text7.SelStart = 0
- Text7.SelLength = Len(Text7.Text)
- End Sub
- Private Sub Text5_Change()
- On Error GoTo err0
- With Adodc5
- .RecordSource = "select 姓名,代码 from dotcode where 代码='" & Text5.Text & "'"
- .Refresh
- If .Recordset.AbsolutePosition <> adPosUnknown Then
- Text5.Text = .Recordset.Fields("姓名")
- End If
- End With
- Exit Sub
- err0:
- MsgBox "数据库连接失败!"
- End Sub