?? 收銀員檔案管理.frm
字號(hào):
VERSION 5.00
Begin VB.Form 收銀員檔案管理
Caption = "收銀員檔案管理"
ClientHeight = 4335
ClientLeft = 60
ClientTop = 345
ClientWidth = 7035
LinkTopic = "Form1"
ScaleHeight = 4335
ScaleWidth = 7035
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command4
Caption = "退 出"
Height = 555
Left = 5460
TabIndex = 11
Top = 3420
Width = 1275
End
Begin VB.CommandButton Command3
Caption = "查 詢"
Height = 555
Left = 5490
TabIndex = 10
Top = 2460
Width = 1275
End
Begin VB.CommandButton Command2
Caption = "刪 除"
Height = 555
Left = 5400
TabIndex = 9
Top = 1380
Width = 1275
End
Begin VB.CommandButton Command1
Caption = "保 存"
Height = 555
Left = 5490
TabIndex = 8
Top = 360
Width = 1275
End
Begin VB.TextBox Text1
Height = 345
Index = 3
Left = 2010
TabIndex = 7
Top = 3150
Width = 2535
End
Begin VB.TextBox Text1
Height = 345
Index = 2
Left = 2010
TabIndex = 5
Top = 2460
Width = 2535
End
Begin VB.TextBox Text1
Height = 345
Index = 1
Left = 2010
TabIndex = 4
Top = 1770
Width = 2535
End
Begin VB.TextBox Text1
Height = 345
Index = 0
Left = 2010
TabIndex = 3
Top = 1080
Width = 2535
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "收銀員聯(lián)系地址"
Height = 465
Index = 3
Left = 570
TabIndex = 6
Top = 3210
Width = 1365
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "收銀員聯(lián)系方式"
Height = 465
Index = 2
Left = 570
TabIndex = 2
Top = 2520
Width = 1365
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "收銀員編號(hào)"
Height = 465
Index = 1
Left = 900
TabIndex = 1
Top = 1830
Width = 1365
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "收銀員名字"
Height = 465
Index = 0
Left = 960
TabIndex = 0
Top = 1140
Width = 1365
End
End
Attribute VB_Name = "收銀員檔案管理"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Command1_Click()
Dim txtSQL As String
Dim txtsql1(0 To 3) As String
Dim mrc As ADODB.Recordset
Dim MsgText As String
If Trim(Text1(0).Text) = "" Then
MsgBox "請(qǐng)輸入收銀員名字!", vbOKOnly + vbExclamation, "警告"
Exit Sub
Text1(1).SetFocus
Else
txtSQL = "select * from 收銀員信息表"
Set mrc = ExecuteSQL(txtSQL, MsgText)
While (mrc.EOF = False)
If Trim(mrc.Fields("收銀員名字")) = Trim(Text1(0)) Then
MsgBox "該收銀員已經(jīng)存在,請(qǐng)單擊修改項(xiàng)!", vbOKOnly + vbExclamation, "警告"
Exit Sub
Else
mrc.MoveNext
End If
Wend
End If
mrc.AddNew
mrc.Fields("收銀員名字") = Trim(Text1(0).Text)
mrc.Fields("收銀員編號(hào)") = Trim(Text1(1).Text)
mrc.Fields("收銀員聯(lián)系方式") = Trim(Text1(2).Text)
mrc.Fields("收銀員聯(lián)系地址") = Trim(Text1(3).Text)
MsgBox "添加收銀員信息成功!", vbOKOnly + vbExclamation, "添加信息"
mrc.Update
mrc.Close
Text1(0).Text = ""
Text1(1).Text = ""
Text1(2).Text = ""
Text1(3).Text = ""
End Sub
Private Sub Command2_Click()
'Dim intCount As Integer
' If flaggedit Then
' If 收銀員查詢結(jié)果.msglist.Rows > 1 Then
' intCount = 收銀員查詢結(jié)果.msglist.Row
' 收銀員查詢結(jié)果.txtsql = "select * from 收銀員查詢結(jié)果 where 收銀員名字'" & Trim(收銀員查詢結(jié)果.msglist.TextMatrix(intCount, 1)) & "'"
' 收銀員查詢結(jié)果.Show
' Else
' Call Command2_Click
' End If
'Else
' 收銀員查詢結(jié)果.txtsql = "select * from 收銀員信息表"
' ' 收銀員查詢結(jié)果.Show
' End If
Dim txtSQL As String
Dim intCount As Integer
Dim mrc As ADODB.Recordset
Dim MsgText As String
If 收銀員查詢結(jié)果.msglist.Rows > 1 Then
If MsgBox("真的要?jiǎng)h除這條文件記錄么?", vbOKCancel + vbExclamation, "警告") = vbOK Then
intCount = 收銀員查詢結(jié)果.msglist.Row
txtSQL = "delete from 收銀員查詢結(jié)果 where 收銀員編號(hào)='" & Trim(收銀員查詢結(jié)果.msglist.TextMatrix(intCount, 1)) & "'"
' txtSQL = "delete from 收銀員查詢結(jié)果 where 收銀員編號(hào)='trim(text1(1).text)'or 收銀員名字='trim(text1(0).text)'"
Set mrc = ExecuteSQL(txtSQL, MsgText)
Unload 收銀員查詢結(jié)果
收銀員查詢結(jié)果.txtSQL = "select * from 收銀員信息表"
收銀員查詢結(jié)果.Show
End If
End If
End Sub
Private Sub Command3_Click()
Dim mrc As ADODB.Recordset
Dim txtSQL(0 To 3) As String
Dim MsgText As String
Dim K(0 To 3) As Integer
Dim i, d As Integer
Dim v As Integer
For i = 0 To 3
If Trim(Text1(i).Text) = "" Then v = v + 1
Next i
If v = 4 Then
MsgBox "沒有選擇查詢條件!"
Exit Sub
End If
For d = 0 To 3
If Trim(Text1(d).Text) <> "" Then
K(d) = d
Select Case K(d)
Case 0
txtSQL(0) = "select * from 收銀員信息表 where 收銀員名字 = '" & Text1(0).Text & "'"
Set mrc = ExecuteSQL(txtSQL(0), MsgText)
If mrc.EOF = True Then
MsgBox "對(duì)不起,暫時(shí)沒有符合條件的收銀員!", vbOKOnly + vbExclamation, "警告"
End If
Case 1
txtSQL(1) = "select * from 收銀員信息表 where 收銀員編號(hào) = '" & Text1(1).Text & "'"
Set mrc = ExecuteSQL(txtSQL(1), MsgText)
If mrc.EOF = True Then
MsgBox "對(duì)不起,暫時(shí)沒有符合條件的收銀員!", vbOKOnly + vbExclamation, "警告"
End If
Case 2
txtSQL(2) = "select * from 收銀員信息表 where 收銀員聯(lián)系電話 = '" & Text1(2).Text & "'"
Set mrc = ExecuteSQL(txtSQL(2), MsgText)
If mrc.EOF = True Then
MsgBox "對(duì)不起,無(wú)此樣電話記錄!", vbOKOnly + vbExclamation, "警告"
End If
Case 3
txtSQL(3) = "select * from 收銀員信息表 where 收銀員聯(lián)系地址 = '" & Text1(3).Text & "'"
Set mrc = ExecuteSQL(txtSQL(3), MsgText)
If mrc.EOF = True Then
MsgBox "對(duì)不起,暫時(shí)沒有地址!", vbOKOnly + vbExclamation, "警告"
End If
End Select
End If
Next d
收銀員查詢結(jié)果.txtSQL = txtSQL(0) & txtSQL(1) & txtSQL(2) & txtSQL(3)
收銀員查詢結(jié)果.Show
End Sub
Private Sub Command4_Click()
Unload Me
End Sub
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -