📄 f21.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form f21
BackColor = &H00FFC0C0&
Caption = "Form1"
ClientHeight = 7710
ClientLeft = 60
ClientTop = 450
ClientWidth = 7770
LinkTopic = "Form1"
ScaleHeight = 7710
ScaleWidth = 7770
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
Caption = "取消"
BeginProperty Font
Name = "幼圆"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4680
TabIndex = 14
Top = 6360
Width = 1815
End
Begin VB.TextBox t6
BackColor = &H00E0E0E0&
Height = 375
Left = 2520
TabIndex = 13
Top = 5640
Width = 1935
End
Begin VB.CommandButton Command1
Caption = "提交"
BeginProperty Font
Name = "幼圆"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2520
TabIndex = 5
Top = 6360
Width = 1815
End
Begin VB.TextBox t5
BackColor = &H00E0E0E0&
Height = 375
Left = 2520
TabIndex = 4
Top = 4800
Width = 2655
End
Begin VB.TextBox t4
BackColor = &H00E0E0E0&
Height = 375
Left = 2520
TabIndex = 3
Top = 4200
Width = 1695
End
Begin VB.TextBox t3
BackColor = &H00E0E0E0&
Height = 375
Left = 2520
TabIndex = 2
Top = 3480
Width = 1695
End
Begin VB.TextBox t2
BackColor = &H00E0E0E0&
Height = 375
Left = 2520
TabIndex = 1
Top = 2760
Width = 1695
End
Begin VB.TextBox t1
BackColor = &H00E0E0E0&
Height = 375
Left = 2520
TabIndex = 0
Top = 2160
Width = 4335
End
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 8040
Top = 2160
Width = 1695
_ExtentX = 2990
_ExtentY = 661
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=MSDASQL.1;Password=19871111;Persist Security Info=True;User ID=sa;Data Source=medicine"
OLEDBString = "Provider=MSDASQL.1;Password=19871111;Persist Security Info=True;User ID=sa;Data Source=medicine"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from input"
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 Label4
BackColor = &H00FFC0C0&
Caption = "入库编号"
BeginProperty Font
Name = "幼圆"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1200
TabIndex = 12
Top = 5640
Width = 1095
End
Begin VB.Label Label7
BackColor = &H00FFC0C0&
Caption = "入库日期"
BeginProperty Font
Name = "幼圆"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1200
TabIndex = 11
Top = 2760
Width = 1095
End
Begin VB.Label Label6
BackColor = &H00FFC0C0&
Caption = "入库价格"
BeginProperty Font
Name = "幼圆"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1200
TabIndex = 10
Top = 4800
Width = 1095
End
Begin VB.Label Label5
BackColor = &H00FFC0C0&
Caption = "负责人"
BeginProperty Font
Name = "幼圆"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1440
TabIndex = 9
Top = 3480
Width = 855
End
Begin VB.Label Label3
BackColor = &H00FFC0C0&
Caption = "数量"
BeginProperty Font
Name = "幼圆"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1680
TabIndex = 8
Top = 4200
Width = 615
End
Begin VB.Label Label2
BackColor = &H00FFC0C0&
Caption = "药品名称"
BeginProperty Font
Name = "幼圆"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1200
TabIndex = 7
Top = 2160
Width = 1095
End
Begin VB.Label Label1
BackColor = &H00FFC0C0&
Caption = "填写入库登记表"
BeginProperty Font
Name = "幼圆"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 2520
TabIndex = 6
Top = 1200
Width = 2415
End
End
Attribute VB_Name = "f21"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub t12_Change()
End Sub
Private Sub t17_Change()
End Sub
Private Sub Command1_Click()
Dim sql As String
If Trim(t6.Text) = "" Then
MsgBox "入库编号不能为空!", vbOKOnly
Exit Sub
End If
sql = "select * from input where 进货号='" & t6 & " '"
Adodc1.RecordSource = sql
Adodc1.Refresh
If Adodc1.Recordset.BOF Then
Else
MsgBox "编号已存在!", vbOKOnly
Exit Sub
End If
If Trim(t1.Text) = "" Then
MsgBox "药名不能为空!", vbOKOnly
Exit Sub
End If
sql = "select * from med where 药名='" & t1 & " '"
Adodc1.RecordSource = sql
Adodc1.Refresh
If Adodc1.Recordset.BOF Then
MsgBox "该药品不存在!", vbOKOnly
Exit Sub
End If
If Trim(t2.Text) = "" Then
MsgBox "日期不能为空!", vbOKOnly
Exit Sub
End If
If Trim(t4.Text) = "" Then
MsgBox "数量不能为空!", vbOKOnly
Exit Sub
End If
If Trim(t3.Text) = "" Then
MsgBox "负责人不能为空!", vbOKOnly
Exit Sub
End If
If Trim(t5.Text) = "" Then
MsgBox "入库价格不能为空!", vbOKOnly
Exit Sub
End If
Dim sqlstr As String
sqlstr = "select * from input"
Adodc1.RecordSource = sqlstr
Adodc1.Refresh
Adodc1.Recordset.AddNew
Adodc1.Recordset.Fields("药名") = Trim(t1)
Adodc1.Recordset.Fields("日期") = Trim(t2)
Adodc1.Recordset.Fields("数量") = Trim(t4)
Adodc1.Recordset.Fields("负责人") = Trim(t3)
Adodc1.Recordset.Fields("进价") = Trim(t5)
Adodc1.Recordset.Fields("进货号") = Trim(t6)
Adodc1.Recordset.Update
Me.Hide
MsgBox "记录已添加!", vbOKOnly
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -