?? main_xszz_xszzgl_lr.frm
字號:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form main_xszz_xszzgl_lr
BorderStyle = 3 'Fixed Dialog
Caption = "Form1"
ClientHeight = 4200
ClientLeft = 45
ClientTop = 330
ClientWidth = 6885
Icon = "main_xszz_xszzgl_lr.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4200
ScaleWidth = 6885
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command1
Caption = "確定"
Height = 390
Left = 1605
TabIndex = 9
Top = 3705
Width = 1770
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 390
Left = 3495
TabIndex = 8
Top = 3705
Width = 1770
End
Begin VB.Frame Frame1
Height = 3690
Left = 0
TabIndex = 0
Top = -75
Width = 6885
Begin VB.TextBox Text1
Height = 330
Index = 10
Left = 825
TabIndex = 26
Top = 3240
Width = 5970
End
Begin VB.TextBox Text1
Height = 330
Index = 9
Left = 2985
TabIndex = 24
Top = 2865
Width = 3810
End
Begin MSComCtl2.DTPicker DTPicker1
Height = 330
Left = 840
TabIndex = 22
Top = 2865
Width = 1350
_ExtentX = 2381
_ExtentY = 582
_Version = 393216
Format = 19660801
CurrentDate = 38716
End
Begin VB.TextBox Text1
Height = 765
Index = 8
Left = 840
TabIndex = 20
Top = 2055
Width = 5955
End
Begin VB.CommandButton cmdQY
Caption = "…"
Height = 285
Left = 6450
TabIndex = 19
Top = 585
Width = 315
End
Begin VB.TextBox Text1
Height = 330
Index = 7
Left = 4065
TabIndex = 16
Top = 1680
Width = 2730
End
Begin VB.TextBox Text1
Height = 330
Index = 6
Left = 840
TabIndex = 15
Top = 1680
Width = 2715
End
Begin VB.TextBox Text1
Height = 330
Index = 5
Left = 840
TabIndex = 14
Top = 1305
Width = 5955
End
Begin VB.TextBox Text1
Height = 330
Index = 1
Left = 2955
TabIndex = 5
Top = 180
Width = 3840
End
Begin VB.TextBox Text1
Height = 330
Index = 2
Left = 840
TabIndex = 4
Top = 555
Width = 1290
End
Begin VB.TextBox Text1
Height = 330
Index = 3
Left = 2955
Locked = -1 'True
TabIndex = 3
Top = 555
Width = 3840
End
Begin VB.TextBox Text1
Height = 330
Index = 0
Left = 840
Locked = -1 'True
TabIndex = 2
Top = 180
Width = 1290
End
Begin VB.TextBox Text1
Height = 330
Index = 4
Left = 840
TabIndex = 1
Top = 930
Width = 5970
End
Begin VB.Label Label12
Caption = "備注"
Height = 165
Left = 405
TabIndex = 27
Top = 3330
Width = 405
End
Begin VB.Label Label11
Caption = "核心產(chǎn)品"
Height = 165
Left = 2220
TabIndex = 25
Top = 2910
Width = 1020
End
Begin VB.Label Label10
Caption = "成立日期"
Height = 165
Left = 75
TabIndex = 23
Top = 2910
Width = 780
End
Begin VB.Label Label3
Caption = "簡介"
Height = 165
Left = 405
TabIndex = 21
Top = 2100
Width = 390
End
Begin VB.Label Label9
Caption = "郵編"
Height = 165
Left = 3630
TabIndex = 18
Top = 1785
Width = 390
End
Begin VB.Label Label8
Caption = "Email"
Height = 165
Left = 300
TabIndex = 17
Top = 1755
Width = 480
End
Begin VB.Label Label7
Caption = "電話"
Height = 165
Left = 375
TabIndex = 13
Top = 1365
Width = 405
End
Begin VB.Label Label6
Caption = "地址"
Height = 165
Left = 375
TabIndex = 12
Top = 1005
Width = 405
End
Begin VB.Label Label5
Caption = "所在區(qū)域"
Height = 165
Left = 2190
TabIndex = 11
Top = 615
Width = 720
End
Begin VB.Label Label4
Caption = "負(fù)責(zé)人"
Height = 165
Left = 225
TabIndex = 10
Top = 600
Width = 540
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "編號"
ForeColor = &H000000FF&
Height = 165
Left = 390
TabIndex = 7
Top = 225
Width = 375
End
Begin VB.Label Label2
Caption = "名稱"
ForeColor = &H000000FF&
Height = 165
Left = 2505
TabIndex = 6
Top = 270
Width = 375
End
End
End
Attribute VB_Name = "main_xszz_xszzgl_lr"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rs1 As New ADODB.Recordset
Private Sub Form_Activate()
Text1(1).SetFocus
If IntLoadDataTree = 1 Then
Text1(4).SetFocus
End If
End Sub
Private Sub Form_Load()
If blnAddXSZZ = True Then
Me.Caption = "銷售組織添加"
rs1.Open "select * from 銷售組織表 order by 編號", Cnn, adOpenKeyset
If rs1.RecordCount > 0 Then
rs1.MoveLast
Text1(0) = Format(Val(rs1.Fields("編號")) + 1, "00000")
Else
Text1(0) = "00001"
End If
rs1.Close
For i = 1 To Text1.UBound
Text1(i) = ""
Next i
Else
Me.Caption = "銷售組織修改"
With main_xszz_xszzgl.Adodc1.Recordset
For i = 0 To 8
If .Fields(i) <> "" Then Text1(i) = .Fields(i)
Next i
If .Fields(9) <> "" Then DTPicker1.Value = .Fields(9)
If .Fields(10) <> "" Then Text1(9) = .Fields(10)
If .Fields(12) <> "" Then Text1(10) = .Fields(12)
End With
End If
End Sub
Private Sub Text1_GotFocus(Index As Integer)
Text1(Index).BackColor = &HFFFF00
Text1(Index).SelStart = 0
Text1(Index).SelLength = Len(Text1(Index))
End Sub
Private Sub Text1_LostFocus(Index As Integer)
Text1(Index).BackColor = &H80000005
End Sub
Private Sub Text1_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn And Index = 1 Then Text1(2).SetFocus
If KeyCode = vbKeyReturn And Index = 2 Then Text1(3).SetFocus
If KeyCode = vbKeyReturn And Index = 3 Then cmdQY.SetFocus
If KeyCode = vbKeyReturn And Index > 3 And Index < 8 Then Text1(Index + 1).SetFocus
If KeyCode = vbKeyReturn And Index = 8 Then DTPicker1.SetFocus
If KeyCode = vbKeyReturn And Index = 9 Then Text1(10).SetFocus
If KeyCode = vbKeyReturn And Index = 10 Then Command1.SetFocus
End Sub
Private Sub DTPicker1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Text1(9).SetFocus
End Sub
Private Sub Combo1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Text1(2).SetFocus
End Sub
Private Sub cmdQY_Click()
Load main_datatree
main_datatree.Show 1
IntLoadDataTree = 1
End Sub
Private Sub Command1_Click()
On Error GoTo SaveErr
If blnAddXSZZ = True Then
Cnn.Execute ("insert into 銷售組織表 values('" + Text1(0) + "','" + Text1(1) + "','" + _
Text1(2) + "','" + Text1(3) + "','" + Text1(4) + "','" + Text1(5) + "','" + Text1(6) + _
"','" + Text1(7) + "','" + Text1(8) + "','" + Str(DTPicker1.Value) + "','" + Text1(9) + _
"',1,'" + Text1(10) + "')")
Else
Cnn.Execute ("update 銷售組織表 set 名稱 ='" + Text1(1) + "',負(fù)責(zé)人='" + Text1(2) + _
"',所在區(qū)域 ='" + Text1(3) + "',地址='" + Text1(4) + "',電話='" + Text1(5) + "',Email='" + _
Text1(6) + "',郵編='" + Text1(7) + "',簡介 ='" + Text1(8) + "',成立日期='" + _
Str(DTPicker1.Value) + "',核心產(chǎn)品='" + Text1(9) + "',備注='" + Text1(10) + "'where 編號 ='" + _
Text1(0) + "'")
End If
main_xszz_xszzgl.Adodc1.Refresh
If XSZZBookmark <> "" Then main_xszz_xszzgl.DataGrid1.Bookmark = XSZZBookmark
Unload Me
Exit Sub
SaveErr:
MsgBox Err.Description
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -