?? form02.frm
字號:
End
Begin VB.Menu mnuD6
Caption = "D6.重整帳目"
End
End
Begin VB.Menu mnuT
Caption = "T.退出"
End
End
Attribute VB_Name = "Form02"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
' ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
' ┃ Form02 操作員權限菜單窗口 ┃
' ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
Dim strDat As String, datDat As Date, nS_Dy As Integer
Dim strDa1 As String, strDa2 As String
Dim strTName As String, StrSQL As String, strMcd As String, strJcd As String, strBzd As String
Dim intNsc As Integer
Dim strDmp, strTmp, strPmp As String
Dim strFmm, strFdb As String
Dim Rq As String, Je As Single
'
Private Sub Form_Load() ' 初始化
If myF_ConnT(Db_fN2) = False Then Unload Me: Exit Sub ' 連接庫 T
Me.Caption = " " & StrGum & StrShm
Label1.Caption = Format(Now, "yyyy.mm.dd hh:mm'ss")
Label4.Visible = False
Label5.Caption = StrDwm
Me.Top = (Screen.Height - Me.Height) / 2
Me.Left = (Screen.Width - Me.Width) / 2
Frame1.Top = 2 * (Me.Height - Frame1.Height) / 5
Frame1.Left = (Me.Width - Frame1.Width) / 2
mnuD6.Enabled = False
End Sub
Private Sub Form_Activate() ' ???
StrT2 = "T_zm"
If myF_ExistT(StrT2) < 1 Then ' 檢查帳目表
' Me.mnuA.Item.Enabled = False
Command3.Enabled = False
Text3 = " " & StrCrq
Text4 = ""
Frame2.Top = Frame1.Top
Frame2.Left = Frame1.Left
Frame2.Visible = True
Text4.SetFocus
Else
Command2.SetFocus
End If
End Sub
Private Sub Text3_Change()
If Len(Trim(Text3)) > 10 Then
MsgBox " 應輸入" & StrCrq & " 格式的日期 ... ", 48, " 請注意"
Text3 = ""
End If
End Sub
Private Sub Text3_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text4.SetFocus
End If
End Sub
Private Sub Text3_LostFocus()
'
Text3 = " " & Format(Trim(Text3), "yyyy.mm.dd")
End Sub
Private Sub Text4_Change()
Command3.Enabled = False
If Text4 = "" Then Exit Sub
If IsNumeric(Text4) Then
If Val(Text4) < 0 Then
MsgBox " 應輸入大于 0 的數字 ... ", 48, " 請注意"
Text4 = ""
Else
Command3.Enabled = True
End If
Else
MsgBox " 應輸入大于 0 的數字 ... ", 48, " 請注意"
Text4 = ""
End If
End Sub
Private Sub Text4_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Command3.SetFocus
End If
End Sub
Private Sub Text4_LostFocus()
Text4 = Format(Text4, " 0.00")
End Sub
Private Sub Command3_Click()
Rq = Trim(Text3)
Je = Val(Text4)
Frame2.Visible = False
If myF_ExistT(StrT2) < 0 Then ' 帳目表
StrSQL = "CREATE TABLE " & StrT2 & " ( " & _
" Rq text(10),Xh short," & _
" Sz text(1),Lb text(1),Mc text(40)," & _
" Dj single,Sl short,Sr single,Zc single,Ye single," & _
" Bh short,Bz text(30) )"
cnnTce.Execute StrSQL, , adCmdText
End If
StrSQL = "INSERT Into " & StrT2 & "( Rq,Xh,Sz,Lb,Mc,Dj,Sl,Sr,Zc,Ye,Bh,Bz ) " & _
" VALUES( '" & Rq & "',0,' ',' ','前余',0,0,0,0," & Je & ",0,' ')"
cnnTce.Execute StrSQL, , adCmdText
End Sub
Private Sub Command4_Click()
Unload Me
End Sub
Private Sub mnuA_Click(Index As Integer)
FormA0.Show ' 帳目錄入
End Sub
Private Sub mnuB_Click(Index As Integer)
FormB0.Show ' 修改
End Sub
Private Sub mnuC1_Click()
FormC1.Show ' 分類查詢
End Sub
Private Sub mnuC2_Click()
FormC2.Show ' 查詢藥費
End Sub
Private Sub mnuD1_Click()
FormD1.Show ' 更名
End Sub
Private Sub mnuD2_Click()
FormD2.Show ' 條目
End Sub
Private Sub mnuD4_Click()
FormD4.Show ' 備份
End Sub
Private Sub mnuD5_Click()
FormD5.Show ' 修改密碼
End Sub
Private Sub mnuD6_Click() ' 重整帳目
FormD6.Show
End Sub
Private Sub mnuT_Click()
Unload Me ' Exit Quit 結束程序
End Sub
Private Sub Form_Unload(Cancel As Integer)
On Error Resume Next
MyDb1.Close
MyDb2.Close
End Sub
Private Sub Timer1_Timer() ' 定時器 interval = 900 約 1 秒
Label1.Caption = Format(Now, "yyyy.mm.dd hh:mm'ss")
End Sub
Private Sub Command1_Click() ' 調整系統時間
If Command1.Caption Like "*調*" Then
Label1.Caption = Format(Now, "yyyy.mm.dd hh:mm'ss")
Label2.Visible = True
Label3.Visible = True
Label4.Visible = False
Text1.Text = Format(Date, "yyyy.mm.dd")
Text2.Text = Time
Text1.Visible = True
Text2.Visible = True
Text2.SetFocus
Command1.Caption = "確 認 "
Command2.Caption = "放 棄"
Else ' 確認存盤
Call P_Dtcp
End If
End Sub
Private Sub Command2_Click() ' 放棄調整
If Command2.Caption Like "*棄*" Then
Label2.Visible = False
Label3.Visible = False
Label4.Visible = False
Text1.Visible = False
Text2.Visible = False
Command1.Caption = "調 整"
Command2.Caption = "關 閉"
Else
Timer1.Enabled = False
Frame1.Visible = False ' 關閉 Frame1 timer ? ?
mnuD1.Enabled = True
' mnuE5.Enabled = True
End If
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text2.SetFocus
End If
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Command1.SetFocus
End If
End Sub
Private Sub Command1_KeyPress(KeyAscii As Integer) ' 確認存盤
If KeyAscii = 13 Then
Call P_Dtcp
End If
End Sub
Private Sub P_Dtcp() ' 系統時間確認存盤
strDat = Text1.Text
Date = myF_ctod(strDat)
Time = Text2.Text
Label1.Caption = Now
Label2.Visible = False
Label3.Visible = False
Text1.Visible = False
Text2.Visible = False
Command1.Caption = "調 整"
Command2.Caption = "關 閉"
End Sub
'%**************************************************
Private Sub mnuE5_Click() ' 調整系統時間
Timer1.Enabled = True
Frame1.Visible = True
mnuD1.Enabled = False
mnuE5.Enabled = False
End Sub
Private Sub bak() ' 關閉對象 ???
Dim Ws As Workspace
Dim Db As Database
Dim Rs As Recordset
For Each Ws In Workspaces
For Each Db In Ws.Databases
'For Each Rs In Db.Recordset
' Rs.Close
' Set Rs = noting
'Next
Db.Close
Set Db = noting
Next
Next
End
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -