?? frmuserinfo.frm
字號(hào):
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form FrmUserInfo
BorderStyle = 3 'Fixed Dialog
Caption = "反饋信息"
ClientHeight = 4755
ClientLeft = 45
ClientTop = 330
ClientWidth = 7770
Icon = "FrmUserInfo.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4755
ScaleWidth = 7770
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.Frame Frame1
Caption = "反饋信息"
Height = 3495
Left = 120
TabIndex = 14
Top = 120
Width = 7455
Begin VB.TextBox TxtShenFen
Height = 375
Left = 960
Locked = -1 'True
TabIndex = 23
ToolTipText = "用戶身份 不可編輯"
Top = 1440
Width = 2775
End
Begin VB.TextBox TxtName
Height = 375
Left = 960
Locked = -1 'True
TabIndex = 6
Top = 360
Width = 2775
End
Begin VB.OptionButton SexMan
Caption = "男"
Height = 375
Left = 960
TabIndex = 16
Top = 960
Value = -1 'True
Width = 495
End
Begin VB.OptionButton SexFemail
Caption = "女"
Height = 375
Left = 1680
TabIndex = 15
Top = 960
Width = 495
End
Begin VB.TextBox TxtDanWei
Height = 375
Left = 960
Locked = -1 'True
TabIndex = 7
Top = 1920
Width = 2775
End
Begin VB.TextBox TxtDiZhi
Height = 375
Left = 960
Locked = -1 'True
TabIndex = 8
Top = 2400
Width = 2775
End
Begin VB.TextBox TxtEmail
Height = 375
Left = 960
Locked = -1 'True
TabIndex = 9
Top = 2880
Width = 2775
End
Begin VB.TextBox TxtInfo
Height = 3015
Left = 3840
Locked = -1 'True
MultiLine = -1 'True
ScrollBars = 3 'Both
TabIndex = 10
Top = 240
Width = 3495
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "反饋信息:"
Height = 180
Left = 2835
TabIndex = 24
Top = 1080
Width = 900
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "身份:"
Height = 180
Left = 240
TabIndex = 22
Top = 1560
Width = 540
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "姓名:"
Height = 180
Left = 240
TabIndex = 21
Top = 435
Width = 540
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "性別:"
Height = 180
Left = 240
TabIndex = 20
Top = 1035
Width = 540
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "單位:"
Height = 180
Left = 240
TabIndex = 19
Top = 2040
Width = 540
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "地址:"
Height = 180
Left = 240
TabIndex = 18
Top = 2520
Width = 540
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "E-mail:"
Height = 180
Left = 120
TabIndex = 17
Top = 3000
Width = 720
End
End
Begin VB.Frame Frame2
Caption = "導(dǎo)航按鈕"
Height = 855
Left = 120
TabIndex = 11
Top = 3720
Width = 7455
Begin VB.CommandButton CmdUp
Caption = "上一條"
Height = 375
Left = 1110
TabIndex = 1
Top = 360
Width = 855
End
Begin VB.CommandButton CmdNext
Caption = "下一條"
Height = 375
Left = 1995
TabIndex = 2
Top = 360
Width = 855
End
Begin VB.CommandButton CmdFirst
Caption = "第一條"
Height = 375
Left = 240
TabIndex = 0
Top = 360
Width = 855
End
Begin VB.CommandButton CmdLast
Caption = "末一條"
Height = 375
Left = 2865
TabIndex = 3
Top = 360
Width = 855
End
Begin VB.CommandButton CmdNew
Caption = "添加"
Height = 375
Left = 3735
TabIndex = 4
Top = 360
Width = 855
End
Begin VB.CommandButton CmdUpdate
Caption = "修改"
Enabled = 0 'False
Height = 375
Left = 4605
TabIndex = 13
Top = 360
Width = 855
End
Begin VB.CommandButton CmdDelete
Caption = "刪除"
Enabled = 0 'False
Height = 375
Left = 5490
TabIndex = 12
Top = 360
Width = 855
End
Begin VB.CommandButton CmdClose
Cancel = -1 'True
Caption = "關(guān)閉"
Height = 375
Left = 6360
TabIndex = 5
Top = 360
Width = 855
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 6120
Top = 0
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
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = ""
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
End
End
Attribute VB_Name = "FrmUserInfo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub CmdClose_Click()
Unload Me
End Sub
Private Sub CmdFirst_Click()
Dim SexManValue As String
Adodc1.Recordset.MoveFirst
CmdUp.Enabled = False
CmdFirst.Enabled = False
CmdNext.Enabled = True
CmdLast.Enabled = True
TxtShenFen.Text = Adodc1.Recordset!身份 & ""
SexManValue = Adodc1.Recordset!性別 & ""
TxtName.Text = Adodc1.Recordset!姓名 & ""
TxtDanWei.Text = Adodc1.Recordset!單位 & ""
TxtDiZhi.Text = Adodc1.Recordset!地址 & ""
TxtEmail.Text = Adodc1.Recordset!電子郵件 & ""
TxtInfo.Text = Adodc1.Recordset!反饋信息 & ""
If SexManValue = "男" Then
SexMan.Value = True
Else
SexFemail.Value = True
End If
End Sub
Private Sub CmdLast_Click()
Dim SexManValue As String
Adodc1.Recordset.MoveLast
CmdNext.Enabled = False
CmdLast.Enabled = False
CmdUp.Enabled = True
CmdFirst.Enabled = True
TxtShenFen.Text = Adodc1.Recordset!身份 & ""
SexManValue = Adodc1.Recordset!性別 & ""
TxtName.Text = Adodc1.Recordset!姓名 & ""
TxtDanWei.Text = Adodc1.Recordset!單位 & ""
TxtDiZhi.Text = Adodc1.Recordset!地址 & ""
TxtEmail.Text = Adodc1.Recordset!電子郵件 & ""
TxtInfo.Text = Adodc1.Recordset!反饋信息 & ""
If SexManValue = "男" Then
SexMan.Value = True
Else
SexFemail.Value = True
End If
End Sub
Private Sub CmdNew_Click()
On Error GoTo errEnd
If CmdNew.Caption <> "確定" Then
TxtName.Locked = False
TxtDanWei.Locked = False
TxtDiZhi.Locked = False
TxtEmail.Locked = False
TxtInfo.Locked = False
TxtName.Text = ""
TxtDanWei.Text = ""
TxtDiZhi.Text = ""
TxtEmail.Text = ""
TxtInfo.Text = ""
TxtShenFen.Text = UserShenFen
CmdNew.Caption = "確定"
CmdFirst.Enabled = False
CmdUp.Enabled = False
CmdNext.Enabled = False
CmdLast.Enabled = False
Exit Sub
End If
If TxtName.Text = "" Then
MsgBox "請(qǐng)輸入你的姓名!", vbOKOnly + vbExclamation, "信息反饋"
TxtName.SetFocus
Exit Sub
End If
If TxtDanWei.Text = "" Then
TxtDanWei.Text = "未知"
End If
If TxtDiZhi.Text = "" Then
TxtDiZhi.Text = "未知"
End If
If TxtEmail.Text = "" Then
TxtEmail.Text = "未知"
End If
If TxtInfo.Text = "" Then
MsgBox "請(qǐng)?zhí)顚懛答佇畔?", vbOKOnly + vbExclamation, "信息反饋"
TxtInfo.SetFocus
Exit Sub
End If
Adodc1.Recordset.AddNew
Adodc1.Recordset!姓名 = TxtName.Text
Adodc1.Recordset!身份 = UserShenFen
If SexMan.Value Then
Adodc1.Recordset!性別 = "男"
Else
Adodc1.Recordset!性別 = "女"
End If
Adodc1.Recordset!單位 = TxtDanWei.Text
Adodc1.Recordset!地址 = TxtDiZhi.Text
Adodc1.Recordset!電子郵件 = TxtEmail.Text
Adodc1.Recordset!反饋信息 = TxtInfo.Text
Adodc1.Recordset!反饋日期 = Now
Adodc1.Recordset.Update
MsgBox "感謝你的意見(jiàn)或建議!", vbOKOnly + vbInformation, "信息反饋"
CmdNew.Caption = "添加"
CmdFirst.Enabled = True
CmdUp.Enabled = True
CmdNext.Enabled = True
CmdLast.Enabled = True
TxtName.Locked = True
TxtDanWei.Locked = True
TxtDiZhi.Locked = True
TxtEmail.Locked = True
TxtInfo.Locked = True
Call CmdLast_Click
Exit Sub
errEnd:
MsgBox Err.Description, vbOKOnly + vbExclamation, "數(shù)據(jù)庫(kù)錯(cuò)誤"
End Sub
Private Sub CmdNext_Click()
Dim SexManValue As String
If Adodc1.Recordset.EOF Then Exit Sub
Adodc1.Recordset.MoveNext
If Adodc1.Recordset.EOF Then
Call CmdLast_Click
Exit Sub
End If
CmdUp.Enabled = True
CmdFirst.Enabled = True
TxtShenFen.Text = Adodc1.Recordset!身份 & ""
SexManValue = Adodc1.Recordset!性別 & ""
TxtName.Text = Adodc1.Recordset!姓名 & ""
TxtDanWei.Text = Adodc1.Recordset!單位 & ""
TxtDiZhi.Text = Adodc1.Recordset!地址 & ""
TxtEmail.Text = Adodc1.Recordset!電子郵件 & ""
TxtInfo.Text = Adodc1.Recordset!反饋信息 & ""
If SexManValue = "男" Then
SexMan.Value = True
Else
SexFemail.Value = True
End If
End Sub
Private Sub CmdUp_Click()
Dim SexManValue As String
If Adodc1.Recordset.BOF Then Exit Sub
Adodc1.Recordset.MovePrevious
If Adodc1.Recordset.BOF Then
Call CmdFirst_Click
Exit Sub
End If
CmdNext.Enabled = True
CmdLast.Enabled = True
TxtShenFen.Text = Adodc1.Recordset!身份 & ""
SexManValue = Adodc1.Recordset!性別 & ""
TxtName.Text = Adodc1.Recordset!姓名 & ""
TxtDanWei.Text = Adodc1.Recordset!單位 & ""
TxtDiZhi.Text = Adodc1.Recordset!地址 & ""
TxtEmail.Text = Adodc1.Recordset!電子郵件 & ""
TxtInfo.Text = Adodc1.Recordset!反饋信息 & ""
If SexManValue = "男" Then
SexMan.Value = True
Else
SexFemail.Value = True
End If
End Sub
Private Sub Form_Activate()
If Adodc1.Recordset.RecordCount > 0 Then
Call CmdFirst_Click
Else
MsgBox "當(dāng)前沒(méi)有客戶反饋信息!", vbOKOnly + vbInformation, "客戶反饋"
Call CmdNew_Click
End If
End Sub
Private Sub Form_Load()
Dim dbName As String
Dim connSTR As String
On Error GoTo errEnd
ChDir App.Path
dbName = App.Path
If Right(dbName, 1) <> "\" Then dbName = dbName + "\"
dbName = dbName + "DataBase\WFSSDataBase.mdb"
connSTR = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dbName & ";Persist Security Info=False"
Adodc1.ConnectionString = connSTR
Adodc1.CommandType = adCmdTable
Adodc1.RecordSource = "客戶反饋"
Adodc1.Refresh
Exit Sub
errEnd:
MsgBox "連接數(shù)據(jù)庫(kù)失敗!", vbOKOnly + vbExclamation, "打開(kāi)數(shù)據(jù)庫(kù)出錯(cuò)"
End
End Sub
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -