📄 viewform.frm
字号:
Connect = "Access"
DatabaseName = "E:\jp\vb\生日餐会系统\BSystem.mdb"
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 345
Left = 1440
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "社区资料"
Top = 2760
Visible = 0 'False
Width = 1215
End
Begin VB.Label Label21
AutoSize = -1 'True
Caption = "所属社区:"
Height = 180
Left = 120
TabIndex = 60
Top = 2880
Width = 900
End
Begin VB.Label Label15
Caption = "已通知:"
Height = 255
Left = 120
TabIndex = 58
Top = 4080
Width = 735
End
Begin VB.Label Label12
AutoSize = -1 'True
Caption = "*"
ForeColor = &H000000FF&
Height = 180
Index = 2
Left = 3120
TabIndex = 55
Top = 2160
Width = 90
End
Begin VB.Label Label13
AutoSize = -1 'True
Caption = "注: * 为必填字段"
ForeColor = &H000000FF&
Height = 180
Left = 3240
TabIndex = 46
Top = 4320
Width = 1530
End
Begin VB.Label Label12
AutoSize = -1 'True
Caption = "*"
ForeColor = &H000000FF&
Height = 180
Index = 1
Left = 2520
TabIndex = 45
Top = 720
Width = 90
End
Begin VB.Label Label12
AutoSize = -1 'True
Caption = "*"
ForeColor = &H000000FF&
Height = 180
Index = 0
Left = 2280
TabIndex = 44
Top = 360
Width = 90
End
Begin VB.Label Label11
AutoSize = -1 'True
Caption = "参加生日餐会次数:"
Height = 180
Left = 120
TabIndex = 43
Top = 3720
Width = 1620
End
Begin VB.Label Label10
AutoSize = -1 'True
Caption = "所在学校:"
Height = 180
Left = 120
TabIndex = 42
Top = 3240
Width = 900
End
Begin VB.Label Label9
AutoSize = -1 'True
Caption = "母亲姓名:"
Height = 180
Left = 2520
TabIndex = 41
Top = 2520
Width = 900
End
Begin VB.Label Label8
AutoSize = -1 'True
Caption = "父亲姓名:"
Height = 180
Left = 120
TabIndex = 40
Top = 2520
Width = 900
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "邮编:"
Height = 180
Left = 120
TabIndex = 39
Top = 1800
Width = 540
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "联系方式:"
Height = 180
Left = 120
TabIndex = 38
Top = 2160
Width = 900
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "家庭地址:"
Height = 180
Left = 120
TabIndex = 37
Top = 1440
Width = 900
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "性别:"
Height = 180
Left = 120
TabIndex = 36
Top = 1080
Width = 540
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "阴历:"
Height = 180
Left = 3120
TabIndex = 35
Top = 720
Visible = 0 'False
Width = 540
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "出生年月:"
Height = 180
Left = 120
TabIndex = 34
Top = 720
Width = 900
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "姓名:"
Height = 180
Left = 120
TabIndex = 33
Top = 360
Width = 540
End
End
End
Attribute VB_Name = "ViewForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'Public const ViewFWidth = 5300
Private Type StuViewForm 'VIEWFORM窗体的外部变量
SelectName As Integer
End Type
Dim flagViewForm As StuViewForm
Private Sub Check1_Click()
If Check1.Value = Checked Then
Check1.Enabled = False
EBookTime (True)
GetBookData
' DTPicker2.SetFocus
ElseIf Check1.Value = Unchecked Then
EBookTime (False)
End If
End Sub
Private Sub Command1_Click()
'判断姓名字段
If Text1.text = "" Then
MsgBox "姓名不能为空!"
Text1.SetFocus
Exit Sub
Else
ViewForm.Enabled = False
SelName.Show
End If
End Sub
'''''''''''''''''''''''
'''''''取消生日餐会
Private Sub Command2_Click()
If MsgBox("是否确定取消餐会?", vbYesNo, "取消餐会对话框") = vbYes Then
SetCheck1 (True)
CBookTime
EBookTime (False)
DelBookData
End If
End Sub
'''''''''''''''''''''''
''''''保存按钮
Private Sub Command3_Click()
'判断必填字段
If Text1.text = "" Then
MsgBox "姓名不能为空!"
Exit Sub
End If
If Text4.text = "" Then
MsgBox "电话不能为空!"
Exit Sub
End If
'保存基本资料
SaveBaseInfo
'保存预订餐会
If Check1.Value Then
SaveBookData
End If
'清值
ClearFrameValue
'重建生日餐会
ModifyBthdInfo
End Sub
Private Sub Command4_Click()
Unload Me
End Sub
Private Sub Command5_Click()
If MsgBox("是否确定删除此人信息?" & Chr(34) & "如果确定删除,将删除有关此人的所有信息!", vbYesNo, "取消餐会对话框") = vbYes Then
'清值
DelBaseInfo
DelBookData
DelBthdData
ModifyBthdInfo
' Check1.Value = Unchecked
' Check1.Enabled = True
' CBookTime
' EBookTime (False)
' DelBookData
ClearFrameValue
End If
'Dim strSel As String
'strSel = "Select * from 餐会信息 where ID = " & CStr(flagViewForm.SelectName)
'Data1.RecordSource = strSel
'Data1.ReadOnly = True
'Data1.Refresh
End Sub
Private Sub Command6_Click()
BthdInfo.SetBthdInfoFlag (JP_SET_NUM_ADD)
BthdInfo.Show
End Sub
Private Sub Command7_Click()
If Text9.text = 0 Then
MsgBox "没有数据!"
Exit Sub
End If
Dim strSel As String
strSel = "Select * from 餐会信息 where ID = " & CStr(flagViewForm.SelectName)
Data1.RecordSource = strSel
Data1.ReadOnly = True
Data1.Refresh
If Data1.Recordset.RecordCount <> 0 Then
Data1.Recordset.MoveFirst
If Data1.Recordset.NoMatch = False Then
Data1.Recordset.Move (MSFlexGrid1.Row - 1)
BthdInfo.SetBthdInfoFlag (Data1.Recordset.Fields("PARTY_ID"))
End If
End If
'BthdInfo.SetBthdInfoFlag (JP_SET_NUM_CHG)
BthdInfo.Show
End Sub
Private Sub Command8_Click()
'删除生日餐会临时数据
DelBthdTemporaryData
'建生日餐会表
ModifyBthdInfo
'清ID
'flagViewForm.SelectName = -1
'清值
ClearFrameValue
End Sub
Private Sub Command9_Click()
'SaveBookData
'延时保存
'WaitDelay (2)
'CloseData
CopyBookInfoToBthdData
End Sub
Private Sub DBCombo1_Change()
''
Dim b As String
b = DBCombo1.text
End Sub
Private Sub Form_Activate()
'MSFlexGrid1.Refresh
End Sub
Private Sub Form_Load()
InitData
ModifyForm
'建生日餐会表
ModifyBthdInfo
If flagViewForm.SelectName = -1 Then
'清值
ClearFrameValue
Else
' ViewForm.Enabled = True
EBaseInfo (True)
EBthdInfo (True)
SetCheck1 (False)
GetBaseInfo
' ViewForm.GetBthdData
End If
End Sub
Private Sub InitData()
Data1.DatabaseName = App.Path & "\BSystem.mdb"
Data2.DatabaseName = App.Path & "\BSystem.mdb"
If tyUserStru.sUserLev >= JP_SET_USER_LEVEL2 Then
Command5.Enabled = True
Else
Command5.Enabled = False
End If
'Data2.RecordSource = "SELECT 社区名称 FROM 社区资料"
'Data2.Refresh'
'
'Dim num As Integer
'num = 0
'Combo1.text = ""
'With Data2.Recordset
' If Not .EOF Then
' .MoveLast
' If .RecordCount <> 0 Then
' dbcombo1.
' End If
' End If
'End With
End Sub
Private Sub CloseData()
Data1.Database.Close
Data2.Database.Close
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''主框架
Private Sub ModifyForm()
With Me
Dim frame_xoff As Integer
frame_xoff = 5
.Top = 100
.Left = 1000
.Height = 7600 '窗体长
.Width = 8350 '窗体宽
.Frame1.Top = 100 '基本资料框偏移Y
.Frame1.Left = 100 '基本资料框偏移X
.Frame1.Height = 5000 '基本资料框长
.Frame1.Width = 5100 '基本资料框宽
.Frame2.Top = Frame1.Top
.Frame2.Left = Frame1.Left + Frame1.Width + frame_xoff
.Frame2.Width = 3050 '预定信息框宽
.Frame2.Height = Frame1.Height
.Frame3.Top = Frame1.Top + Frame1.Height
.Frame3.Left = Frame1.Left
.Frame3.Width = Frame1.Width + Frame2.Width + frame_xoff
' .Text1.MaxLength = 5
End With
End Sub
'''''''''''''''''''''''
'清值
Public Function ClearFrameValue()
Text1.text = "" '姓名
DTPicker1.Value = "1990-1-1" '出生年月
Text2.text = "" '阴历
Option1(JP_SET_NUM_MALE).Value = True '性别
Text3.text = "" '家庭地址
Text4.text = "" '联系方式
Text5.text = "" '邮编
Text6.text = "" '父亲姓名
Text7.text = "" '母亲姓名
Text8.text = "" '所在学校
Text9.text = "0" '参加生日餐会次数
Text9.Enabled = False
DBCombo1.text = "" '社区
'SetCheck1 (True)
'基本信息显示
EBaseInfo (False)
'生日餐会信息
EBthdInfo (False)
'预订信息显示
CBookTime
EBookTime (False)
Check1.Value = Unchecked '预订餐会
Check1.Enabled = False
'清ID
flagViewForm.SelectName = -1
End Function
''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''预订信息的使用显示
''清空
Public Function CBookTime()
DTPicker2.Value = Date
DTPicker3.Value = #12:00:00 AM#
Text11.text = "" '小孩人数
Text12.text = "" '大人人数
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -