📄 selrepform.frm
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomct2.ocx"
Object = "{FAEEE763-117E-101B-8933-08002B2F4F5A}#1.1#0"; "DBLIST32.OCX"
Begin VB.Form SelRepForm
BorderStyle = 1 'Fixed Single
Caption = "选择报表"
ClientHeight = 4065
ClientLeft = 45
ClientTop = 330
ClientWidth = 4920
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
Moveable = 0 'False
ScaleHeight = 4065
ScaleWidth = 4920
Begin VB.CommandButton Command1
Caption = "退出"
Height = 375
Left = 3840
TabIndex = 6
Top = 3600
Width = 975
End
Begin VB.CommandButton Command2
Caption = "确定"
Height = 375
Left = 2760
TabIndex = 5
Top = 3600
Width = 975
End
Begin VB.Frame Frame1
Height = 3495
Left = 0
TabIndex = 0
Top = 0
Width = 4815
Begin VB.TextBox Text2
Height = 270
Left = 2520
TabIndex = 14
Top = 2685
Width = 495
End
Begin VB.TextBox Text1
Height = 270
Left = 1440
TabIndex = 12
Top = 2685
Width = 495
End
Begin VB.CheckBox Check2
Caption = "输入年龄段"
Height = 375
Left = 240
TabIndex = 11
Top = 2640
Visible = 0 'False
Width = 1335
End
Begin MSDBCtls.DBCombo DBCombo1
Bindings = "SelRepForm.frx":0000
Height = 330
Left = 1320
TabIndex = 10
Top = 2235
Width = 1575
_ExtentX = 2778
_ExtentY = 582
_Version = 393216
IntegralHeight = 0 'False
Style = 2
ListField = "社区名称"
Text = ""
End
Begin VB.CheckBox Check1
Caption = "选择社区"
Height = 255
Left = 240
TabIndex = 9
Top = 2280
Width = 1095
End
Begin VB.OptionButton Option1
Caption = "查看完成生日餐会资料报表"
Height = 255
Index = 1
Left = 240
TabIndex = 8
Top = 1200
Width = 2535
End
Begin VB.OptionButton Option1
Caption = "查看基本资料报表"
Height = 255
Index = 0
Left = 240
TabIndex = 7
Top = 840
Width = 1935
End
Begin MSComCtl2.DTPicker DTPicker2
Height = 255
Left = 3120
TabIndex = 1
Top = 360
Width = 1335
_ExtentX = 2355
_ExtentY = 450
_Version = 393216
Format = 156434433
CurrentDate = 38121
End
Begin MSComCtl2.DTPicker DTPicker1
Height = 255
Left = 1560
TabIndex = 2
Top = 360
Width = 1335
_ExtentX = 2355
_ExtentY = 450
_Version = 393216
Format = 156434433
CurrentDate = 38118
End
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = "E:\jp\vb\生日餐会系统\BSystem.mdb"
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 345
Left = 1920
Options = 0
ReadOnly = -1 'True
RecordsetType = 1 'Dynaset
RecordSource = "社区资料"
Top = 2160
Visible = 0 'False
Width = 1215
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "岁"
Height = 180
Left = 3120
TabIndex = 15
Top = 2730
Width = 180
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "岁到"
Height = 180
Left = 2040
TabIndex = 13
Top = 2730
Width = 360
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "选择报表时间:"
Height = 180
Left = 120
TabIndex = 4
Top = 360
Width = 1260
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "~"
Height = 180
Left = 3000
TabIndex = 3
Top = 480
Width = 90
End
End
End
Attribute VB_Name = "SelRepForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Check1_Click()
If Check1.Value = Unchecked Then
'Check1.Value = Checked
DBCombo1.Enabled = False
DBCombo1.text = ""
ElseIf Check1.Value = Checked Then
' Check1.Value = Unchecked
DBCombo1.Enabled = True
DBCombo1.text = ""
End If
End Sub
Private Sub Check2_Click()
If Check2.Value = Checked Then
Text1.Enabled = True
Text2.Enabled = True
Label3.Enabled = True
Label4.Enabled = True
' Text2.text = "5"
' Text3.text = "18"
ElseIf Check2.Value = Unchecked Then
Text1.Enabled = False
Text2.Enabled = False
Label3.Enabled = False
Label4.Enabled = False
' Text2.text = ""
' Text3.text = ""
End If
End Sub
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub Command2_Click()
ReportView.Show
Unload Me
End Sub
Private Sub DTPicker1_Change()
If DTPicker1.Value > DTPicker2.Value Then
MsgBox "不能比后面的时间早!", vbOKOnly, "提示"
DTPicker1.Value = DTPicker2.Value
DTPicker1.Refresh
End If
End Sub
Private Sub DTPicker2_Change()
If DTPicker2.Value < DTPicker1.Value Then
MsgBox "不能比前面的时间晚!", vbOKOnly, "提示"
DTPicker2.Value = Date
DTPicker2.Refresh
End If
End Sub
Private Sub Form_Load()
InitSelRepForm
End Sub
Private Function InitSelRepForm()
Data1.DatabaseName = App.Path & "\BSystem.mdb"
Me.Top = 1800
Me.Left = 2200
Me.Width = 5000
Me.Height = 4400
DTPicker1.Value = DateSerial(Year(Date), Month(Date), 1)
DTPicker2.Value = Date
Option1(0).Value = True
Option1(1).Value = False
Check1.Visible = True
DBCombo1.Visible = True
Check1.Value = Unchecked
DBCombo1.Enabled = False
DBCombo1.text = ""
Check2.Visible = True
Text1.Visible = True
Text2.Visible = True
Label3.Visible = True
Label4.Visible = True
Check2.Value = Unchecked
Text1.text = "5"
Text2.text = "18"
Text1.Enabled = False
Text2.Enabled = False
Label3.Enabled = False
Label4.Enabled = False
End Function
Private Sub Option1_Click(Index As Integer)
If Option1(0).Value Then
SRFOptionFlag (True)
DBCombo1.text = ""
ElseIf Option1(1).Value Then
SRFOptionFlag (False)
DBCombo1.text = ""
End If
End Sub
Private Sub Text1_GotFocus()
Text1.SelStart = 0
Text1.SelLength = Len(Text1)
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii < 48 Or KeyAscii > 57 Then
KeyAscii = 0
End If
End Sub
Private Sub Text1_LostFocus()
On Error GoTo ERR:
If CInt(Text1.text) > 0 And CInt(Text1.text) < 100 Then
Exit Sub
End If
ERR:
MsgBox "输入错误,请输入1~99内的数值。"
Text1.SetFocus
End Sub
Private Sub Text2_GotFocus()
Text2.SelStart = 0
Text2.SelLength = Len(Text2)
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii < 48 Or KeyAscii > 57 Then
KeyAscii = 0
End If
End Sub
Private Sub Text2_LostFocus()
On Error GoTo ERR:
If CInt(Text2.text) > 0 And CInt(Text2.text) < 100 Then
If CInt(Text2.text) >= CInt(Text1.text) Then
Exit Sub
Else
MsgBox "输入值必须比前一数值大。"
Text2.SetFocus
Exit Sub
End If
End If
ERR:
MsgBox "输入错误,请输入1~99内的数值。"
Text2.SetFocus
End Sub
Private Sub SRFOptionFlag(flag As Boolean)
Check1.Visible = flag
DBCombo1.Visible = flag
Check2.Visible = flag
Text1.Visible = flag
Text2.Visible = flag
Label3.Visible = flag
Label4.Visible = flag
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -