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

📄 frmsdgl.frm

📁 水电费管理信息系统。用VB编写
💻 FRM
📖 第 1 页 / 共 2 页
字号:
   End
   Begin VB.Label Label10 
      Caption         =   "元"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   9000
      TabIndex        =   22
      Top             =   2160
      Width           =   495
   End
   Begin VB.Label Label9 
      Caption         =   "月    份"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   240
      TabIndex        =   20
      Top             =   1560
      Width           =   1215
   End
   Begin VB.Label Label8 
      Caption         =   "应收电费"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   6600
      TabIndex        =   13
      Top             =   2760
      Width           =   1215
   End
   Begin VB.Label Label7 
      Caption         =   "应收水费"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   6600
      TabIndex        =   12
      Top             =   2160
      Width           =   1215
   End
   Begin VB.Label Label6 
      Caption         =   "元/度"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   5520
      TabIndex        =   9
      Top             =   2760
      Width           =   615
   End
   Begin VB.Label Label5 
      Caption         =   "元/吨"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   5520
      TabIndex        =   8
      Top             =   2160
      Width           =   615
   End
   Begin VB.Label Label4 
      Caption         =   "本月用电量"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   120
      TabIndex        =   3
      Top             =   2760
      Width           =   1215
   End
   Begin VB.Label Label3 
      Caption         =   "本月用水量"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   120
      TabIndex        =   2
      Top             =   2160
      Width           =   1215
   End
   Begin VB.Label Label2 
      Caption         =   "姓    名"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   240
      TabIndex        =   1
      Top             =   960
      Width           =   1215
   End
   Begin VB.Label Label1 
      Caption         =   "用户代码"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   240
      TabIndex        =   0
      Top             =   480
      Width           =   1215
   End
End
Attribute VB_Name = "frmSDGL"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
  Data1.Recordset.MoveFirst  '显示首条记录
End Sub

Private Sub Command2_Click()
  If Data1.Recordset.BOF Then  '显示当前记录的前一条记录
    Beep
    MsgBox "已到达文件首部!", , "提示"
    Data1.Recordset.MovePrevious
  Else
    Data1.Recordset.MovePrevious
    If Data1.Recordset.BOF Then
       Beep
       MsgBox "已到达文件首部!", , "提示"
       Data1.Recordset.MoveFirst
    End If
  End If
End Sub

Private Sub Command3_Click()
  If Data1.Recordset.EOF Then   '显示当前记录的后一条记录
    Beep
    MsgBox "已到达文件尾部!", , "提示"
    Data1.Recordset.MoveLast
  Else
    Data1.Recordset.MoveNext
    If Data1.Recordset.EOF Then
      Beep
      MsgBox "已到达文件尾部!", , "提示"
      Data1.Recordset.MoveLast
    End If
  End If
End Sub

Private Sub Command4_Click()
  Data1.Recordset.MoveLast   '显示最后一条记录
End Sub

Private Sub Command5_Click()
  If Command5.Caption = "修改记录" Then  '如果按钮为"修改记录",则等待修改数据;如查为"确定",则更新到数据库中
    Data1.Recordset.Edit
    Command5.Caption = "确定"
    Text1.SetFocus
    Text1.Locked = False
    Text2.Locked = False
    Text3.Locked = False
    Text4.Locked = False
    Text5.Locked = False
    Text6.Locked = False
    Text7.Locked = False
    Text8.Locked = False
    Text9.Locked = False
    Command1.Enabled = False
    Command2.Enabled = False
    Command3.Enabled = False
    Command4.Enabled = False
    Command6.Enabled = False
    
    Command8.Enabled = False
  Else
    Command5.Caption = "修改记录"
    Text1.Locked = True
    Text2.Locked = True
    Text3.Locked = True
    Text4.Locked = True
    Text5.Locked = True
    Text6.Locked = True
    Text7.Locked = True
    Text8.Locked = True
    Text9.Locked = True
    Command1.Enabled = True
    Command2.Enabled = True
    Command3.Enabled = True
    Command4.Enabled = True
    Command6.Enabled = True
    
    Command8.Enabled = True
  End If
End Sub

Private Sub Command6_Click()
  If Not Data1.Recordset.EOF Then
    If MsgBox("确信要删除该用户信息吗?", vbOKCancel, "警告") = vbCancel Then
      Exit Sub
    End If
      Data1.Recordset.Delete
      Data1.Recordset.MoveNext
  End If
End Sub

Private Sub Command7_Click()

End Sub

Private Sub Command8_Click()
  Unload Me
End Sub

Private Sub Data1_Reposition()
  dataid = Data1.Recordset.AbsolutePosition + 1  '当前记录改变后,显示当前记录号
  Label16.Caption = "第" & Str(dataid) & "条记录"
End Sub

Private Sub Form_Load()
    Text1.Locked = True
    Text2.Locked = True
    Text3.Locked = True
    Text4.Locked = True
    Text5.Locked = True
    Text6.Locked = True
    Text7.Locked = True
    Text8.Locked = True
    Text9.Locked = True
  Data1.DatabaseName = App.Path + "\水电费管理系统数据库.mdb"
  Data1.RecordSource = "水电费表"
End Sub

⌨️ 快捷键说明

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