📄 form1.frm
字号:
Strikethrough = 0 'False
EndProperty
Height = 375
Index = 0
Left = 480
TabIndex = 9
Top = 4560
Width = 1215
End
Begin VB.Label Label5
Caption = "数量"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Index = 0
Left = 480
TabIndex = 8
Top = 5280
Width = 1215
End
Begin VB.Label Label6
Caption = "年"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 480
TabIndex = 7
Top = 6000
Width = 375
End
Begin VB.Label Label7
Caption = "时间"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Index = 1
Left = 720
TabIndex = 6
Top = 6840
Width = 1215
End
Begin VB.Label Label8
Caption = "存取厂家名称"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Index = 1
Left = 5280
TabIndex = 5
Top = 3360
Width = 1215
End
Begin VB.Label Label9
Caption = "存取人姓名"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Index = 1
Left = 5280
TabIndex = 4
Top = 2640
Width = 1215
End
Begin VB.Label Label10
Caption = "出入库选择"
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1800
TabIndex = 3
Top = 1560
Width = 2295
End
Begin VB.Label Label1
Caption = "生产厂家"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 480
TabIndex = 2
Top = 2640
Width = 1215
End
Begin VB.Label Label11
Caption = "出入库单据"
BeginProperty Font
Name = "宋体"
Size = 24
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 3600
TabIndex = 1
Top = 240
Width = 2535
End
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim cnn1 As ADODB.Connection '连接
Dim mycommand As ADODB.Command '命令
Dim rstByQuery As ADODB.Recordset '结果集
Dim strCnn As String '连接字符串
Dim a As String
Dim b As String
Dim c As String
Dim d As String
Dim e As String
Dim f As String
Dim g As String
Dim h As String
Dim i As String
Dim j As String
Dim k As String
Dim l As String
Private Sub Command1_Click()
a = Combo1.Text
b = Combo2.Text
c = Combo3.Text
d = Combo4.Text
e = Combo5.Text
f = Combo6.Text
g = Text1.Text
h = Text2.Text
i = Text3.Text
j = Text4.Text
k = Text5.Text
l = Text6.Text
If c = "" Or a = "" Or b = "" Or d = "" Or e = "" Or f = "" Or g = "" Or h = "" Or i = "" Or j = "" Or k = "" Or l = "" Then
MsgBox "数据填写不完整"
Combo3.SetFocus
ElseIf f = "出库" Then
sql = "insert into ckudanju values (" + "'" + c + "'" + "," + g + "-" + h + "-" + i + "," + "'" + b + "'" + "," + "'" + d + "'" + "," + "'" + j + "'" + "," + "'" + l + "'" + "," + "'" + k + "'" + "," + e + "," + "'" + a + "'" + ")"
cnn1.Execute (sql)
MsgBox "资料添加成功"
ElseIf f = "入库" Then
sql = "insert into rkudanju values (" + "'" + c + "'" + "," + g + "-" + h + "-" + i + "," + "'" + b + "'" + "," + "'" + d + "'" + "," + "'" + j + "'" + "," + "'" + l + "'" + "," + "'" + k + "'" + "," + e + "," + "'" + a + "'" + ")"
cnn1.Execute (sql)
MsgBox "资料添加成功"
Else
MsgBox "请选择出入库单据类型"
End If
End Sub
Private Sub Command2_Click()
End Sub
Private Sub Command3_Click()
End Sub
Private Sub Command5_Click()
Form3.Show
Unload Form1
End Sub
Private Sub Command6_Click()
End
End Sub
Private Sub Form_Load()
Form1.Hide
Form2.Show
Set cnn1 = New ADODB.Connection '生成一个连接
strCnn = "FileDSN=DBtest.dsn;UID=sa;PWD="
'没有系统数据源使用连接字符串
'strCnn = "DSN=mydsn;UID=sa;PWD=;"
'DATABASE=pubs;Driver={SQL Server};SERVER=gzl_pc" '
'如果系统数据源MYDSN指向PUBS数据库,也可以这样用
cnn1.Open strCnn, , , 0 '打开连接
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -