?? frmsave.frm
字號:
VERSION 5.00
Begin VB.Form frmSave
Caption = "存檔報警記錄"
ClientHeight = 7260
ClientLeft = 60
ClientTop = 348
ClientWidth = 8052
BeginProperty Font
Name = "宋體"
Size = 10.8
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Icon = "frmSave.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 7260
ScaleWidth = 8052
StartUpPosition = 2 'CenterScreen
Begin VB.TextBox txtReson
Height = 372
Left = 1320
TabIndex = 4
Top = 1142
Width = 4968
End
Begin VB.TextBox txtMotorMan
Height = 375
Left = 4716
TabIndex = 3
Top = 637
Width = 1560
End
Begin VB.TextBox txtCarStyle
Height = 375
Left = 4716
TabIndex = 1
Top = 132
Width = 1560
End
Begin VB.TextBox txtCarMan
Height = 375
Left = 1320
TabIndex = 2
Top = 637
Width = 2652
End
Begin VB.TextBox txtCarNumber
Height = 375
Left = 1320
TabIndex = 0
Top = 132
Width = 2652
End
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "退出"
Height = 396
Left = 6492
TabIndex = 8
Top = 2148
Width = 1215
End
Begin VB.CommandButton cmdDelete
Caption = "刪除"
Height = 396
Left = 6492
TabIndex = 6
Top = 804
Width = 1215
End
Begin VB.CommandButton cmdPrint
Caption = "打印..."
Height = 396
Left = 6492
TabIndex = 7
Top = 1476
Width = 1215
End
Begin VB.CommandButton cmdOk
Caption = "存盤"
Default = -1 'True
Height = 396
Left = 6492
TabIndex = 5
Top = 132
Width = 1215
End
Begin VB.Label labPost
BorderStyle = 1 'Fixed Single
Height = 372
Left = 1320
TabIndex = 16
Top = 2148
Width = 4968
End
Begin VB.Label labDirection
BorderStyle = 1 'Fixed Single
Height = 372
Left = 4716
TabIndex = 13
Top = 1644
Width = 1560
End
Begin VB.Label labTime
BorderStyle = 1 'Fixed Single
Caption = "2000年12月31日20:12:45"
Height = 372
Left = 1320
TabIndex = 15
Top = 1644
Width = 2652
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "車主名稱:"
Height = 216
Left = 312
TabIndex = 19
Top = 636
Width = 1080
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "違章地點:"
Height = 216
Left = 312
TabIndex = 18
Top = 2148
Width = 972
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "違章時間:"
Height = 216
Left = 312
TabIndex = 17
Top = 1644
Width = 1080
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "方向:"
Height = 216
Left = 4092
TabIndex = 14
Top = 1644
Width = 648
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "姓名:"
Height = 216
Left = 4092
TabIndex = 12
Top = 648
Width = 648
End
Begin VB.Label Label9
AutoSize = -1 'True
Caption = "車牌號碼:"
Height = 216
Left = 312
TabIndex = 11
Top = 132
Width = 1056
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "車型:"
Height = 216
Left = 4092
TabIndex = 10
Top = 132
Width = 648
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "違章原因:"
Height = 216
Left = 312
TabIndex = 9
Top = 1140
Width = 1080
End
Begin VB.Image Image1
Appearance = 0 'Flat
BorderStyle = 1 'Fixed Single
Height = 4452
Left = 360
Top = 2736
Width = 7368
End
End
Attribute VB_Name = "frmSave"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim itemX As ListItem
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdDelete_Click()
Dim nYesNo As Integer, rs As Recordset
Dim sFile As String
nYesNo = MsgBox("刪除后將無法再恢復,確認刪除嗎?", vbYesNo + vbQuestion, "剔除報警記錄")
If nYesNo = vbYes Then
'數據庫中刪除相應記錄
Set rs = myDB.OpenRecordset("Select * from tabCaptureRec where fldID = " & Format(itemX.Tag))
If Not rs.EOF Then
sFile = GetAppPath & "Jpg\" & rs!fldJpgFile
Kill sFile
rs.Delete
End If
rs.Close
frmServer.bSaveed = True
Unload Me
End If
End Sub
'存檔,至少要車牌號碼
Private Sub cmdOK_Click()
Dim nYesNo As Integer, rs As Recordset
txtCarNumber.Text = Trim(txtCarNumber.Text)
txtCarStyle.Text = Trim(txtCarStyle.Text)
txtCarMan.Text = Trim(txtCarMan.Text)
txtMotorMan.Text = Trim(txtMotorMan.Text)
txtReson.Text = Trim(txtReson.Text)
If txtCarNumber.Text = "" Then
MsgBox "請確定車牌號碼,以便存檔和查詢", , "缺少數據"
txtCarNumber.SetFocus
ElseIf txtCarStyle.Text = "" Or txtReson.Text = "" Or txtCarMan.Text = "" Or txtMotorMan.Text = "" Then
nYesNo = MsgBox("數據不完整,確認存盤嗎?", vbYesNo + vbQuestion, "數據不完整")
If nYesNo = vbNo Then
Exit Sub
End If
End If
Set rs = myDB.OpenRecordset("Select * from tabCaptureRec where fldID = " & Format(itemX.Tag))
If Not rs.EOF Then
rs.Edit
rs!fldCarNumber = txtCarNumber.Text
rs!fldCarMan = txtCarMan.Text
rs!fldMotorMan = txtMotorMan.Text
rs!fldCarStyle = txtCarStyle.Text
rs!fldReson = txtReson.Text
rs!fldState = "存盤"
rs.Update
End If
rs.Close
frmServer.bSaveed = True
MsgBox "存盤完畢,此后通過查詢定位、操作此記錄!"
End Sub
Private Sub cmdPrint_Click()
Dim nYesNo As Integer, rs As Recordset
Dim sPrintID As String, sFile As String
Dim prtDate As Date
txtCarNumber.Text = Trim(txtCarNumber.Text)
txtCarStyle.Text = Trim(txtCarStyle.Text)
txtCarMan.Text = Trim(txtCarMan.Text)
txtMotorMan.Text = Trim(txtMotorMan.Text)
txtReson.Text = Trim(txtReson.Text)
If txtCarNumber.Text = "" Or txtCarStyle.Text = "" Or txtCarMan.Text = "" Or txtMotorMan.Text = "" Or txtReson.Text = "" Then
MsgBox "數據不完整,請確認所有數據后再執行打印操作!"
Exit Sub
Else
sPrintID = GetPrintID
prtDate = Date
Set rs = myDB.OpenRecordset("Select * from tabCaptureRec where fldID = " & Format(itemX.Tag))
If Not rs.EOF Then
rs.Edit
rs!fldCarNumber = txtCarNumber.Text
rs!fldCarMan = txtCarMan.Text
rs!fldMotorMan = txtMotorMan.Text
rs!fldCarStyle = txtCarStyle.Text
rs!fldReson = txtReson.Text
rs!fldPrintID = sPrintID
rs!fldPrintDate = prtDate
rs!fldPrinted = True
rs.Update
End If
rs.Close
sFile = GetAppPath & itemX.SubItems(4)
Call frmPrint.PrintNotes(sPrintID, txtCarMan.Text, txtMotorMan.Text, txtCarNumber.Text, labPost.Caption, labTime.Caption, txtReson.Text, Format(prtDate, "Long Date"), sFile, txtCarStyle.Text)
frmServer.bSaveed = True
End If
End Sub
Private Sub Form_Load()
Set itemX = frmServer.lstViwCapture.SelectedItem
labPost.Caption = itemX.SubItems(1)
labDirection.Caption = itemX.SubItems(2)
labTime.Caption = itemX.SubItems(3)
Image1.Picture = frmServer.Image1.Picture
frmServer.bSaveed = False
End Sub
Private Sub Form_Resize()
Image1.Width = 498 * Screen.TwipsPerPixelX
Image1.Height = 288 * Screen.TwipsPerPixelY
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -