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

📄 frm_xqinfo.frm

📁 主要是实现物业管理功能!可以帮助了解该区的相关物业情况
💻 FRM
📖 第 1 页 / 共 2 页
字号:
         AutoSize        =   -1  'True
         Caption         =   "交工日期:"
         Height          =   180
         Left            =   165
         TabIndex        =   27
         Top             =   3540
         Width           =   900
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "地址"
         Height          =   180
         Index           =   10
         Left            =   165
         TabIndex        =   26
         Top             =   2535
         Width           =   360
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "备注"
         Height          =   180
         Index           =   11
         Left            =   165
         TabIndex        =   25
         Top             =   2985
         Width           =   360
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "占地面积"
         Height          =   180
         Index           =   9
         Left            =   2160
         TabIndex        =   24
         Top             =   1440
         Width           =   720
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "居住面积"
         Height          =   180
         Index           =   7
         Left            =   165
         TabIndex        =   23
         Top             =   1470
         Width           =   720
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "小区名称"
         Height          =   180
         Index           =   1
         Left            =   165
         TabIndex        =   22
         Top             =   360
         Width           =   720
      End
      Begin VB.Label Label10 
         AutoSize        =   -1  'True
         Caption         =   "竣工日期:"
         Height          =   180
         Left            =   2520
         TabIndex        =   21
         Top             =   3540
         Width           =   900
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "建筑面积"
         Height          =   180
         Index           =   6
         Left            =   165
         TabIndex        =   20
         Top             =   912
         Width           =   720
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "绿化面积"
         Height          =   180
         Index           =   8
         Left            =   2160
         TabIndex        =   19
         Top             =   960
         Width           =   720
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "别墅数"
         Height          =   180
         Index           =   4
         Left            =   4080
         TabIndex        =   18
         Top             =   1440
         Width           =   540
      End
   End
End
Attribute VB_Name = "Frm_xqinfo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub view_data()   '声明一个显示reads表中数据的过程
  With Adodc1.Recordset
       For i = 0 To 11
       If .Fields(i) <> "" Then
          Text1(i).Text = .Fields(i)
       Else
          Text1(i).Text = ""
       End If
       If .Fields("图片") <> "" Then
          Lbllj.Caption = .Fields("图片")
          If Dir(.Fields("图片")) <> "" Then
             Picture1.Picture = LoadPicture(.Fields("图片"))
          Else
             MsgBox "此图片路径错误,请更改!"
             Picture1.Picture = LoadPicture("")
          End If
       Else
          Lbllj.Caption = ""
          Picture1.Picture = LoadPicture("")
       End If
       Next i
  End With
End Sub

Private Sub DTPicker1_KeyDown(KeyCode As Integer, Shift As Integer)
  If KeyCode = vbKeyReturn Then DTPicker2.SetFocus
End Sub
Private Sub DTPicker2_KeyDown(KeyCode As Integer, Shift As Integer)
  If KeyCode = vbKeyReturn Then CmdSave.SetFocus
End Sub
Private Sub CmdAdd_Click()
  For i = 1 To 11
      Text1(i).Text = ""
  Next i
  adors.Open "select * from tab_xqinfo order by val(小区编号)", cn, adOpenKeyset, adLockOptimistic
  With adors
  If .RecordCount > 0 Then
     If .EOF = False Then .MoveLast
     Text1(0).Text = Val(.Fields("小区编号")) + 1
  Else
     Text1(0).Text = "1"
  End If
  End With
  adors.Close
  Text1(1).SetFocus
End Sub
Private Sub CmdAddPicture_Click()
  '添加图片
  With CommonDialog1
       .DialogTitle = "选择要追加的图片"
       
       .Filter = "JPG图片|*.JPG"
       .ShowOpen     '打开对话框
       Picture1.Picture = LoadPicture(.FileName)
       Lbllj.Caption = .FileName
  End With
End Sub
Private Sub CmdCancel_Click()
  For i = 1 To 11
      Text1(i).Text = ""
  Next i
  Picture1.Picture = LoadPicture("")
  Lbllj.Caption = ""
End Sub
Private Sub CmdClearPicture_Click()
  Picture1.Picture = LoadPicture("")
End Sub
Private Sub CmdDelete_Click()
  If Adodc1.Recordset.RecordCount > 0 Then
   a = MsgBox("您确实要删除这条数据吗?", vbYesNo)
   If a = vbYes Then
      '删除当前记录
      Adodc1.Recordset.Delete
      Adodc1.Recordset.Update
   End If
  End If
End Sub
Private Sub CmdMD_Click(Index As Integer)
 Select Case Index
 Case Is = 0     '移到第一条记录
  If Not Adodc1.Recordset.BOF Then Adodc1.Recordset.MoveFirst
 Case Is = 1     '移到上一条记录
  If Adodc1.Recordset.RecordCount > 0 Then
   If Adodc1.Recordset.BOF = False Then Adodc1.Recordset.MovePrevious
   If Adodc1.Recordset.BOF = True Then Adodc1.Recordset.MoveFirst
  End If
 Case Is = 2     '移到下一条记录
  If Adodc1.Recordset.RecordCount > 0 Then
   If Adodc1.Recordset.EOF = False Then Adodc1.Recordset.MoveNext
   If Adodc1.Recordset.EOF = True Then Adodc1.Recordset.MoveLast

  End If
 Case Is = 3     '移到最后一条记录
   If Adodc1.Recordset.EOF = False Then Adodc1.Recordset.MoveLast
 End Select
 Call view_data     '调用过程
End Sub
Private Sub CmdSave_Click()
  adors.Open "select * from tab_xqinfo where 小区编号='" & Text1(0) & "'", cn, adOpenKeyset, adLockOptimistic
  If adors.RecordCount > 0 Then
  Set adors = cn.Execute("update tab_xqinfo set 小区名称 ='" & Text1(1) & "',小区说明 ='" & Text1(2) & "',负责人 ='" & Text1(3) & "',楼栋数 ='" & Text1(4) & "',总户数 ='" & Text1(5) & "',建筑面积 ='" & Text1(6) & "',居住面积 ='" & Text1(7) & "',绿化面积 ='" & Text1(8) & "',占地面积 ='" & Text1(9) & "',地址 ='" & Text1(10) & "',备注 ='" & Text1(11) & "',图片 ='" & Lbllj.Caption & "',交工日期='" & DTPicker1 & "',竣工日期='" & DTPicker2 & "'where 小区编号='" & Text1(0) & "'")
   MsgBox "数据保存成功", 32, "管理信息系统"
   Adodc1.Refresh
   CmdCancel_Click
  Else
   adors.AddNew
   For i = 0 To 11
       adors.Fields(i) = Text1(i).Text
   Next i
   adors.Fields(12) = Lbllj.Caption
   adors.Fields(13) = DTPicker1.Value
   adors.Fields(14) = DTPicker2.Value
   adors.Update
   Adodc1.Refresh
   CmdCancel_Click
  End If
  adors.Close
End Sub
Private Sub CmdExit_Click()
  Unload Me
End Sub
Private Sub Form_Load()
  Adodc1.RecordSource = "select * from tab_xqinfo order by 小区编号"
  Adodc1.Refresh
End Sub

Private Sub Frame4_DragDrop(Source As Control, X As Single, Y As Single)

End Sub

Private Sub Text1_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
  If Index < 11 And KeyCode = vbKeyReturn Then
     SendKeys "{Home}+{End}"
     Text1(Index + 1).SetFocus
  End If
  If Index = 11 And KeyCode = vbKeyReturn Then DTPicker1.SetFocus
End Sub

⌨️ 快捷键说明

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