📄 guestdata.frm
字号:
Private Sub Command14_Click()
GeneratePoolPeriodic DTPicker9.Value, DTPicker10.Value
End Sub
Public Sub GeneratePoolPeriodic(startDate As Date, finishdate As Date)
check_RS
rs.Open "exec poolPer #" & startDate & "#,#" & finishdate & "#", Cnn ', adOpenDynamic, adLockOptimistic
With rptPoolper
Set .DataSource = rs
With .Sections("Section4").Controls
For i = 1 To .Count
If TypeOf .Item(i) Is RptLabel Then
If .Item(i).Name = "lblStart" Then
.Item(i).Caption = startDate
ElseIf .Item(i).Name = "lblFinish" Then
.Item(i).Caption = finishdate
End If
End If
Next i
End With
.Refresh
' Unload frmWeekEntry
.Show vbModal
End With
'r
rs.Close
End Sub
Private Sub Command2_Click()
GenerateRestaurantDaily CDate(DTPicker1.Value)
End Sub
Private Sub Command3_Click()
If Combo1.Text = "" Or Text2.Text = "" Then
MsgBox "Missing fields, please enter below.", vbCritical, "IIS-CVH"
Exit Sub
End If
GenerateRestaurantMonthly CInt(Text2.Text), Combo1.ListIndex + 1
End Sub
Private Sub Command5_Click()
If Combo2.Text = "" Or Text4.Text = "" Then
MsgBox "Missing fields, please enter below.", vbCritical, "IIS-CVH"
Exit Sub
End If
GenerateBarMonthly CInt(Text4.Text), Combo2.ListIndex + 1
End Sub
Public Sub GenerateBarMonthly(themonth As Integer, TheYear As Integer)
check_RS
' Set rs = New ADODB.Recordset
rs.Open "exec BarMonthly " & TheYear & "," & themonth, Cnn ', adOpenDynamic, adLockOptimistic
With rptBarMonthly
Set .DataSource = rs
With .Sections("Section4").Controls
For i = 1 To .Count
If TypeOf .Item(i) Is RptLabel Then
If .Item(i).Name = "lblmonth" Then
.Item(i).Caption = Combo2.Text
ElseIf .Item(i).Name = "lblyear" Then
.Item(i).Caption = Text4.Text
End If
End If
Next i
End With
' Unload frmMonthEntry
.Refresh
.Show vbModal
End With
rs.Close
End Sub
Private Sub Command6_Click()
If Combo3.Text = "" Or Text5.Text = "" Then
MsgBox "Missing fields, please enter below.", vbCritical, "IIS-CVH"
Exit Sub
End If
GeneratePoolMonthly CInt(Text5.Text), Combo3.ListIndex + 1
End Sub
Public Sub GeneratePoolMonthly(themonth As Integer, TheYear As Integer)
check_RS1
rs1.Open "exec PoolMonthly " & themonth & "," & TheYear, Cnn 'adOpenDynamic, adLockOptimistic
With rptPoolMonthly
Set .DataSource = rs1
With .Sections("Section4").Controls
For i = 1 To .Count
If TypeOf .Item(i) Is RptLabel Then
If .Item(i).Name = "lblmonth" Then
.Item(i).Caption = Combo3.Text
ElseIf .Item(i).Name = "lblyear" Then
.Item(i).Caption = Text5.Text
End If
End If
Next i
End With
'Unload frmReports
.Refresh
.Show vbModal
End With
rs1.Close
End Sub
Private Sub Command8_Click()
If Text7.Text = "" Then
MsgBox "Missing fields, please enter below.", vbCritical, "IIS-CVH"
Exit Sub
End If
GeneratePoolYearly CInt(Text7.Text)
End Sub
Public Sub GeneratePoolYearly(TheYear As Integer)
check_RS
' Set rs = New ADODB.Recordset
rs.Open "exec PoolYearly " & TheYear, Cnn ', adOpenDynamic, adLockOptimistic
With rptPoolYearly
Set .DataSource = rs
With .Sections("Section4").Controls
For i = 1 To .Count
If TypeOf .Item(i) Is RptLabel Then
'If .Item(i).Name = "lblmonth" Then
' .Item(i).Caption = (themonth)
If .Item(i).Name = "lblyear" Then
.Item(i).Caption = TheYear
End If
End If
Next i
End With
' Unload frmMonthEntry
.Refresh
.Show vbModal
End With
rs.Close
End Sub
Private Sub Command9_Click()
If Text8.Text = "" Then
MsgBox "Missing fields, please enter below.", vbCritical, "IIS-CVH"
Exit Sub
End If
GenerateBarYearly CInt(Text8.Text)
End Sub
Public Sub GenerateBarYearly(TheYear As Integer)
check_RS
' Set rs = New ADODB.Recordset
rs.Open "exec BarYearly " & TheYear, Cnn ', adOpenDynamic, adLockOptimistic
With rptBarYearly
Set .DataSource = rs
With .Sections("Section4").Controls
For i = 1 To .Count
If TypeOf .Item(i) Is RptLabel Then
'If .Item(i).Name = "lblmonth" Then
' .Item(i).Caption = (themonth)
If .Item(i).Name = "lblyear" Then
.Item(i).Caption = TheYear
End If
End If
Next i
End With
' Unload frmMonthEntry
.Refresh
.Show vbModal
End With
rs.Close
End Sub
Private Sub Form_Load()
DTPicker1.Value = Date
DTPicker2.Value = Date
DTPicker3.Value = Date
DTPicker4.Value = Date
DTPicker5.Value = Date
DTPicker6.Value = Date
DTPicker7.Value = Date
DTPicker8.Value = Date
DTPicker9.Value = Date
DTPicker10.Value = Date
dtDaily.Value = Date
dtWeekly.Value = Date
txtyear.Text = Year(Date)
Text2.Text = Year(Date)
Text8.Text = Year(Date)
Text1.Text = Year(Date)
txtYR.Text = Year(Date)
Text4.Text = Year(Date)
Text7.Text = Year(Date)
Text5.Text = Year(Date)
End Sub
Public Sub GenerateRestaurantMonthly(themonth As Integer, TheYear As Integer)
check_RS
' Set rs = New ADODB.Recordset
rs.Open "exec RestaurantMonthly " & TheYear & "," & themonth, Cnn ', adOpenDynamic, adLockOptimistic
With rptRestaurantMonthly
Set .DataSource = rs
With .Sections("Section4").Controls
For i = 1 To .Count
If TypeOf .Item(i) Is RptLabel Then
If .Item(i).Name = "lblmonth" Then
.Item(i).Caption = Combo1.Text
ElseIf .Item(i).Name = "lblyear" Then
.Item(i).Caption = Text2.Text
End If
End If
Next i
End With
' Unload frmMonthEntry
.Refresh
.Show vbModal
End With
rs.Close
End Sub
Public Sub GenerateRestaurantDaily(thedate As Date)
check_RS
rs.Open "exec RestaurantDaily #" & thedate & "#", Cnn ', adOpenDynamic, adLockOptimistic
With rptRestaurantDaily
Set .DataSource = rs
With .Sections("Section4").Controls
For i = 1 To .Count
If TypeOf .Item(i) Is RptLabel Then
If .Item(i).Name = "lblDate" Then
.Item(i).Caption = thedate
End If
End If
Next i
End With
.Refresh
'Unload frmReports
.Show vbModal
End With
rs.Close
End Sub
Public Sub GenerateDailyReport(thedate As Date)
check_RS
rs.Open "exec Daily #" & thedate & "#", Cnn ', adOpenDynamic, adLockOptimistic
With RptDaily
Set .DataSource = rs
With .Sections("Section4").Controls
For i = 1 To .Count
If TypeOf .Item(i) Is RptLabel Then
If .Item(i).Name = "lblDate" Then
.Item(i).Caption = thedate
End If
End If
Next i
End With
.Refresh
'Unload frmReports
.Show vbModal
End With
rs.Close
End Sub
Public Sub GenerateWeeklyReport(startDate As Date, finishdate As Date)
check_RS
rs.Open "exec Weekly #" & startDate & "#,#" & finishdate & "#", Cnn ', adOpenDynamic, adLockOptimistic
With RptWeekly
Set .DataSource = rs
With .Sections("Section4").Controls
For i = 1 To .Count
If TypeOf .Item(i) Is RptLabel Then
If .Item(i).Name = "lblStart" Then
.Item(i).Caption = startDate
ElseIf .Item(i).Name = "lblFinish" Then
.Item(i).Caption = finishdate
End If
End If
Next i
End With
.Refresh
' Unload frmWeekEntry
.Show vbModal
End With
'r
rs.Close
End Sub
Public Sub GenerateMonthlyReport(themonth As Integer, TheYear As Integer)
check_RS
rs.Open "exec Monthly " & themonth & "," & TheYear, Cnn 'adOpenDynamic, adLockOptimistic
With RptMonthly
Set .DataSource = rs
With .Sections("Section4").Controls
For i = 1 To .Count
If TypeOf .Item(i) Is RptLabel Then
If .Item(i).Name = "lblmonth" Then
.Item(i).Caption = ConvertToMonth(themonth)
ElseIf .Item(i).Name = "lblyear" Then
.Item(i).Caption = TheYear
End If
End If
Next i
End With
'Unload frmReports
.Refresh
.Show vbModal
End With
rs.Close
End Sub
Public Sub GenerateYearlyReport(TheYear As Integer)
check_RS
' Set rs = New ADODB.Recordset
rs.Open "exec Yearly " & TheYear, Cnn ', adOpenDynamic, adLockOptimistic
With RptYearly
Set .DataSource = rs
With .Sections("Section4").Controls
For i = 1 To .Count
If TypeOf .Item(i) Is RptLabel Then
'If .Item(i).Name = "lblmonth" Then
' .Item(i).Caption = (themonth)
If .Item(i).Name = "lblyear" Then
.Item(i).Caption = TheYear
End If
End If
Next i
End With
' Unload frmMonthEntry
.Refresh
.Show vbModal
End With
rs.Close
End Sub
Private Sub txtyear_KeyPress(KeyAscii As Integer)
If KeyAscii >= vbKey0 And KeyAscii <= vbKey9 Then
Exit Sub
Else
KeyAscii = vbKeyBack
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -