6.1系统的实现
6.1.1用户登陆
运行效果:
图6.1系统登陆界面
程序代码:
Private Sub Command1_Click()
If Text1.Text = "" And Text2.Text = "" Then
MsgBox "请输入用户名和密码!"
Else
If Text1.Text = "" Then
MsgBox "你还没有输入用户名!"
Text1.SetFocus
Else
If Text2.Text = "" Then
MsgBox "你还没有输入密码!"
Text2.SetFocus
Else
Dim user As String
user = "用户名=" & "'" & Trim(Text1.Text) & "' and " + "密码=" & "'" & Trim(Text2.Text) & "'"
Data1.Recordset.FindFirst user
If Data1.Recordset.NoMatch Then
MsgBox "没有该用户,或密码错误!"
Exit Sub
Else
MDIForm1.Show
Form3.Show
Form19.Label3.Caption = Text1.Text
Unload Me
End If
End If
End If
End If
End Sub
主界面:
图6.2系统主界面
正确登陆后进入主界面,说明该小区物业管理系统的五大功能模块:基本信息管理 住户收费管理 住户文修管理 住户设备管理 系统用户管理。
6.1.2设备文修管理
运行效果:
图6.3设备文修管理界面
代码:
Private Sub Command1_Click()
If Command1.Caption = "添 加" Then
Command1.Caption = "保 存"
Data1.Recordset.AddNew
Text1.SetFocus
Exit Sub
Else
Text1.Locked = True
Data1.Recordset.Update
Data1.Recordset.MoveLast
Command1.Caption = "添 加"
Data1.Refresh
End If
End Sub
Private Sub Command2_Click()
Dim d
d = MsgBox("是否真的删除吗?", vbYesNo + vbQuestion, "删除")
If d = vbYes Then
Data1.Recordset.Delete
Data1.Recordset.MoveNext
If Data1.Recordset.EOF = True Then
Command4.Enabled = False
Data1.Recordset.MovePrevious
If Data1.Recordset.BOF = True Then
Command3.Enabled = False
Command2.Enabled = False
End If
End If
End If
Data1.Refresh
End Sub
Private Sub Command3_Click()
Data1.Recordset.MovePrevious
If Data1.Recordset.BOF Then
Command3.Enabled = False
Data1.Recordset.MoveNext
Else
Command3.Enabled = True
End If
Command4.Enabled = True
End Sub
Private Sub Form_Load()
Data1.DatabaseName = App.Path & "\db.mdb"
Data1.Refresh
Me.Width = 10560
Me.Height = 7650
If Data1.Recordset.EOF Then
Command2.Enabled = False
Command3.Enabled = False
Command4.Enabled = False
End If
End Sub
Private Sub Command5_Click()
If Text1.Locked = True Or Text2.Locked = True Or Text3.Locked = True Or Text4.Locked = True Or Text5.Locked = True Then
MsgBox "请输入查找编号"
Text1.SetFocus
Else
Dim a
a = "单据编号=" & "'" & Text1.Text & "'"
Data1.Recordset.FindFirst a
If Data1.Recordset.NoMatch Then
MsgBox "没有此记录"
Else
End If
End If
End Sub
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] ... 下一页 >>