📄 mdimain.frm
字号:
End Sub
Private Sub b8DateP_Change()
Call Form_DateChange
End Sub
Private Sub b8SBC_BeforeResize(ByVal NewWidth As Integer)
ResizeFb8SBC NewWidth
End Sub
Private Sub ResizeFb8SBC(ByVal NewWidth As Integer)
'resize top side bar
b8SBT.Width = NewWidth / Screen.TwipsPerPixelX
bgSystemBot.Width = NewWidth
'resize quick tabs
Dim i As Integer
For i = 0 To b8ST.UBound
b8ST(i).Left = 60
b8ST(i).Width = NewWidth - 120
Next
'resize window tab
If b8SBC.Visible = True Then
b8CW.SBWidth = NewWidth / Screen.TwipsPerPixelX
Else
b8CW.SBWidth = 0
End If
'call mdi resize to resize all opened mdi childs
MDIForm_Resize
End Sub
Private Sub b8SBC_Resize()
ResizeFb8SBC b8SBC.Width
End Sub
Private Sub b8SBT_Resize()
b8SBC.Width = b8SBT.Width * Screen.TwipsPerPixelX
End Sub
Private Sub b8SBT_SizeChange(ByVal newSizeState As b8Controls4.eSizeState)
If newSizeState = ssContracted Then
b8CW.SBWidth = b8SBC.Width / Screen.TwipsPerPixelX
b8SBC.Visible = True
bgSystemBot.Visible = True
b8LLogoB.Visible = False
Else
b8CW.SBWidth = 0
b8SBC.Visible = False
bgSystemBot.Visible = False
b8LLogoB.Visible = True
End If
'call mdi resize to resize all opened child forms
Call MDIForm_Resize
End Sub
Private Sub b8ST_BeforeExpand(Index As Integer)
'resize contained controlsbeofre expanding
Select Case Index
Case m_TabSearch 'search
'resize
txtSearchWhat.Move 150, txtSearchWhat.Top, b8ST(Index).Width - 300
cmbLookIn.Move 150, cmbLookIn.Top, txtSearchWhat.Width
cmdSearch.Move b8ST(Index).Width - cmdSearch.Width - 150
Case m_TabFilterDate 'filter date
b8DateP.Move 150, b8DateP.Top, b8ST(Index).Width - 300
Case m_TabShowQuickLaunch
listQL.Move 150, listQL.Top, b8ST(Index).Width - 300
End Select
End Sub
Private Sub b8ST_CompleteExpand(Index As Integer)
Dim i As Integer
For i = 0 To b8ST.UBound
If Index <> i Then
If b8ST(i).AutoContract = True Then
b8ST(i).Expanded = False
End If
End If
Next
End Sub
Private Sub b8ST_Resize(Index As Integer)
Dim i As Integer
For i = 1 To b8ST.UBound
b8ST(i).Move b8ST(i).Left, (b8ST(i - 1).Top + b8ST(i - 1).Height) - 15
Next
If b8ST(Index).Expanded = True Then
Select Case Index
Case m_TabSearch 'search
'resize
txtSearchWhat.Move 150, txtSearchWhat.Top, b8ST(Index).Width - 300
cmbLookIn.Move 150, cmbLookIn.Top, txtSearchWhat.Width
cmdSearch.Move b8ST(Index).Width - cmdSearch.Width - 150
Case m_TabFilterDate 'filter date
b8DateP.Move 150, b8DateP.Top, b8ST(Index).Width - 300
Case m_TabShowQuickLaunch
listQL.Move 150, listQL.Top, b8ST(Index).Width - 300
End Select
End If
End Sub
Private Sub listQL_DblClick()
Dim selItem As ListItem
On Error GoTo RAE
Set selItem = listQL.SelectedItem
Select Case selItem.Key
Case "reservation" 'Manage Products"
If allowOpen("frmReservation", CurrUser.USER_NAME) = False Then
MsgBox "You're not allowed to open this form." & vbCrLf & vbCrLf & _
"Please ask permission from your administrator.", vbInformation
Exit Sub
End If
With frmReservation
.Shortcut = True
.Show vbModal
End With
Case "rooms_windows" 'Manage Supliers"
If allowOpen("frmRoomsWindow", CurrUser.USER_NAME) = False Then
MsgBox "You're not allowed to open this form." & vbCrLf & vbCrLf & _
"Please ask permission from your administrator.", vbInformation
Exit Sub
End If
LoadForm frmRoomsWindow
Case "cust" 'Manage Customers"
If allowOpen("frmAllCustomer", CurrUser.USER_NAME) = False Then
MsgBox "You're not allowed to open this form." & vbCrLf & vbCrLf & _
"Please ask permission from your administrator.", vbInformation
Exit Sub
End If
' frmAllCustomer.ShowForm
Case "poad" 'New P.O."
If allowOpen("frmPOEntry", CurrUser.USER_NAME) = False Then
MsgBox "You're not allowed to open this form." & vbCrLf & vbCrLf & _
"Please ask permission from your administrator.", vbInformation
Exit Sub
End If
' frmPOEntry.ShowAdd
Case "sale" 'New Sales Entry"
If allowOpen("frmSIEntry", CurrUser.USER_NAME) = False Then
MsgBox "You're not allowed to open this form." & vbCrLf & vbCrLf & _
"Please ask permission from your administrator.", vbInformation
Exit Sub
End If
' frmSIEntry.ShowAdd
Case "ppm" 'Purchases/Payments Mon."
If allowOpen("frmAllPPM", CurrUser.USER_NAME) = False Then
MsgBox "You're not allowed to open this form." & vbCrLf & vbCrLf & _
"Please ask permission from your administrator.", vbInformation
Exit Sub
End If
' frmAllPPM.ShowForm
Case "sicpm" 'Sales/Cust.Payments Mon."
If allowOpen("frmAllSICPM", CurrUser.USER_NAME) = False Then
MsgBox "You're not allowed to open this form." & vbCrLf & vbCrLf & _
"Please ask permission from your administrator.", vbInformation
Exit Sub
End If
' frmAllSICPM.ShowForm
Case "void" 'Void Products Mon."
If allowOpen("frmAllVoid", CurrUser.USER_NAME) = False Then
MsgBox "You're not allowed to open this form." & vbCrLf & vbCrLf & _
"Please ask permission from your administrator.", vbInformation
Exit Sub
End If
' frmAllVoid.ShowForm
Case "stock" 'Stock Inventory"
If allowOpen("frmAllStockInv", CurrUser.USER_NAME) = False Then
MsgBox "You're not allowed to open this form." & vbCrLf & vbCrLf & _
"Please ask permission from your administrator.", vbInformation
Exit Sub
End If
' frmAllStockInv.ShowForm
Case "checkcust" 'Manage Due Checks (Cust.)"
If allowOpen("frmAllCustPayDueCheck", CurrUser.USER_NAME) = False Then
MsgBox "You're not allowed to open this form." & vbCrLf & vbCrLf & _
"Please ask permission from your administrator.", vbInformation
Exit Sub
End If
' frmAllCustPayDueCheck.ShowForm
Case "checksupp" 'Manage Due Checks (Supp.)"
If allowOpen("frmAllPTSDueCheck", CurrUser.USER_NAME) = False Then
MsgBox "You're not allowed to open this form." & vbCrLf & vbCrLf & _
"Please ask permission from your administrator.", vbInformation
Exit Sub
End If
' frmAllPTSDueCheck.ShowForm
End Select
RAE:
Set selItem = Nothing
End Sub
Private Sub MDIForm_Load()
'show weclome
frmWelcome.ShowForm
'set menus
' Set b8Menus(0).Menu = Me.mnuSystem
' Set b8Menus(1).Menu = Me.mnuRecords
' Set b8Menus(2).Menu = Me.mnuMonitoring
' Set b8Menus(3).Menu = Me.mnuTools
' Set b8Menus(4).Menu = Me.mnuRecA
' Set b8Menus(5).Menu = Me.mnuReports
' Set b8Menus(6).Menu = Me.mnuHelp
'add quick launch items
listQL.ListItems.Add , "reservation", "New Reservation", 1, 1
listQL.ListItems.Add , "rooms_windows", "Rooms", 1, 1
DisplayUserInfo
HideTBButton "", True
frmWelcome.Active
End Sub
Private Sub mnuAccountReceivables_Click()
If allowOpen("frmAccountReceivableList", CurrUser.USER_NAME) = False Then
MsgBox "You're not allowed to open this form." & vbCrLf & vbCrLf & _
"Please ask permission from your administrator.", vbInformation
Exit Sub
End If
LoadForm frmAccountReceivableList
End Sub
Private Sub mnuBackupDatabase_Click()
If allowOpen("frmDBBackup", CurrUser.USER_NAME) = False Then
MsgBox "You're not allowed to open this form." & vbCrLf & vbCrLf & _
"Please ask permission from your administrator.", vbInformation
Exit Sub
End If
' frmDBBackup.ShowForm
End Sub
Private Sub mnuBusinessSource_Click()
If allowOpen("frmBusinessSourceList", CurrUser.USER_NAME) = False Then
MsgBox "You're not allowed to open this form." & vbCrLf & vbCrLf & _
"Please ask permission from your administrator.", vbInformation
Exit Sub
End If
LoadForm frmBusinessSourceList
End Sub
Private Sub mnuChangeDeskClerk_Click()
frmCloseShift.Show 1
End Sub
Private Sub mnuChargeType_Click()
If allowOpen("frmChargeTypeList", CurrUser.USER_NAME) = False Then
MsgBox "You're not allowed to open this form." & vbCrLf & vbCrLf & _
"Please ask permission from your administrator.", vbInformation
Exit Sub
End If
LoadForm frmChargeTypeList
End Sub
Private Sub mnuCheckInHistory_Click()
If allowOpen("frmCheckInList", CurrUser.USER_NAME) = False Then
MsgBox "You're not allowed to open this form." & vbCrLf & vbCrLf & _
"Please ask permission from your administrator.", vbInformation
Exit Sub
End If
LoadForm frmCheckInList
End Sub
Private Sub mnuCompany_Click()
If allowOpen("frmCompanyList", CurrUser.USER_NAME) = False Then
MsgBox "You're not allowed to open this form." & vbCrLf & vbCrLf & _
"Please ask permission from your administrator.", vbInformation
Exit Sub
End If
LoadForm frmCompanyList
End Sub
Private Sub mnuCountries_Click()
If allowOpen("frmCountriesList", CurrUser.USER_NAME) = False Then
MsgBox "You're not allowed to open this form." & vbCrLf & vbCrLf & _
"Please ask permission from your administrator.", vbInformation
Exit Sub
End If
LoadForm frmCountriesList
End Sub
Private Sub mnuCustomers_Click()
If allowOpen("frmCustomersList", CurrUser.USER_NAME) = False Then
MsgBox "You
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -