⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmuserinfo.frm

📁 一个适用于书店的图书管理信息系统
💻 FRM
字号:
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         =   "导航按钮"
      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         =   "关闭"
         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
         Orientation     =   0
         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 "请输入你的姓名!", 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 "请填写反馈信息!", 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 "感谢你的意见或建议!", 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, "数据库错误"
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 "当前没有客户反馈信息!", 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 "连接数据库失败!", vbOKOnly + vbExclamation, "打开数据库出错"
    End
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -