?? frm_cgdd.frm
字號:
End
Begin VB.TextBox Text2
Height = 300
Left = 3240
Locked = -1 'True
TabIndex = 12
Top = 240
Width = 1575
End
Begin VB.TextBox Text1
Height = 300
Left = 1005
TabIndex = 4
Top = 240
Width = 1335
End
Begin VB.Label Label12
Caption = "金額"
ForeColor = &H00C00000&
Height = 255
Left = 5880
TabIndex = 34
Top = 1080
Width = 495
End
Begin VB.Label Label11
BackStyle = 0 'Transparent
Caption = "備注"
ForeColor = &H00C00000&
Height = 200
Left = 2400
TabIndex = 28
Top = 1440
Width = 615
End
Begin VB.Label Label10
BackStyle = 0 'Transparent
Caption = "幣種"
ForeColor = &H00C00000&
Height = 200
TabIndex = 27
Top = 1440
Width = 735
End
Begin VB.Label Label9
BackStyle = 0 'Transparent
Caption = "數量"
ForeColor = &H00C00000&
Height = 255
Left = 4200
TabIndex = 24
Top = 1080
Width = 735
End
Begin VB.Label Label8
BackStyle = 0 'Transparent
Caption = "單價"
ForeColor = &H00C00000&
Height = 375
Left = 2400
TabIndex = 23
Top = 1080
Width = 735
End
Begin VB.Label Label7
BackStyle = 0 'Transparent
Caption = "單位"
ForeColor = &H00C00000&
Height = 255
Left = 120
TabIndex = 21
Top = 1080
Width = 615
End
Begin VB.Label Label6
BackStyle = 0 'Transparent
Caption = "發單日期"
ForeColor = &H00C00000&
Height = 255
Left = 4920
TabIndex = 20
Top = 720
Width = 855
End
Begin VB.Label Label5
BackStyle = 0 'Transparent
Caption = "收貨日期"
ForeColor = &H00C00000&
Height = 255
Left = 2400
TabIndex = 19
Top = 720
Width = 735
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "供應商編號"
ForeColor = &H00C00000&
Height = 255
Left = 100
TabIndex = 15
Top = 720
Width = 975
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "批號"
ForeColor = &H00C00000&
Height = 255
Left = 4920
TabIndex = 13
Top = 360
Width = 615
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "貨物名稱"
ForeColor = &H00C00000&
Height = 255
Left = 2400
TabIndex = 11
Top = 360
Width = 975
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "單號"
ForeColor = &H00C00000&
Height = 375
Left = 120
TabIndex = 3
Top = 360
Width = 1215
End
End
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 1440
Top = 2640
Width = 4335
_ExtentX = 7646
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 1
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=cggl"
OLEDBString = "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=cggl"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from Table_cgdd"
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
End
Attribute VB_Name = "frm_cgdd"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim c
Private Sub Cmd_add_Click() '增加采購訂單信息
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Combo1.Text = ""
Combo2.Text = ""
Combo3.Text = ""
Text1.Locked = True
Cmd_save.Enabled = True
Cmd_add.Enabled = False
Dim temp1
temp1 = Format(Now, "yyyymmdd")
Adodc1.RecordSource = "select * from Table_cgdd where 單號 like '%" + temp1 + "%'order by 單號"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Adodc1.Recordset.MoveLast
Text1.Text = Adodc1.Recordset.Fields("單號")
Text1.Text = Val(Adodc1.Recordset.Fields("單號")) + 1
Else
Text1.Text = Format(Now, "yyyymmdd")
Text1.Text = Text1.Text + "0000"
End If
Adodc1.RecordSource = "select * from Table_cgdd order by 單號"
Adodc1.Refresh
Text2.SetFocus
End Sub
Private Sub Cmd_cancel_Click()
Text1.Locked = False
Cmd_del.Enabled = False
Cmd_save.Enabled = False
Cmd_add.Enabled = True
Cmd_edit.Enabled = False
Call Cmd_add_Click
End Sub
Private Sub Cmd_del_Click() '刪除采購訂單信息
Adodc1.RecordSource = "select * from Table_cgdd"
If Adodc1.Recordset.RecordCount > 0 Then
c = MsgBox("確認要刪除該信息嗎?", 17, "采購管理系統")
If c = vbOK Then
Adodc1.Recordset.Delete
Else
End If
Else
MsgBox "數據庫中的信息為空,沒有可刪除的信息!!", 64, "采購管理系統"
End If
End Sub
Private Sub Cmd_edit_Click()
Call main
c = MsgBox("確認要修改該信息嗎?", 33, "采購管理系統")
If c = vbOK Then
Adodc1.Recordset.Delete
Check1.Value = 0
temp = "訂單"
Set adoRs = adoCon.Execute("insert into Table_cgdd values(" & Text1 & ",'" & Text2 & "','" & Text3 & "','" & Combo1 & "','" & DT1 & "','" & DT2 & "','" & Combo3 & "','" & Combo2 & "','" & Text5 & "','" & Text6 & "','" & Text8 & "','" & Text7 & "','" & Check1 & "','" & temp & "')")
MsgBox "數據修改成功!!", 64, "采購管理系統"
Cmd_edit.Enabled = False
Else
End If
Adodc1.RecordSource = "select * from Table_cgdd order by 單號"
Adodc1.Refresh
adoCon.Close
End Sub
Private Sub Cmd_exit_Click()
Unload Me
End Sub
Private Sub Cmd_refurbish_Click()
Unload Me
frm_cgclgl.Refresh
frm_cgclgl.Show
End Sub
Private Sub Cmd_save_Click()
Call main
If Combo1.Text = "" Then
MsgBox "供應商編號不能為空值!!"
Combo1.SetFocus
Else
Adodc1.RecordSource = "select * from Table_cgdd where 單號='" + Text1.Text + "'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount = 0 Then
c = MsgBox("確認要保存該信息嗎?", 33, "采購管理系統")
If c = vbOK Then
Check1.Value = 0
Dim temp
temp = "訂單"
Set adoRs = adoCon.Execute("insert into Table_cgdd values(" & Text1 & ",'" & Text2 & "','" & Text3 & "','" & Combo1 & "','" & DT1 & "','" & DT2 & "','" & Combo3 & "','" & Combo2 & "','" & Text5 & "','" & Text6 & "','" & Text8 & "','" & Text7 & "','" & Check1 & "','" & temp & "')")
MsgBox "數據保存成功!!", 32, "采購管理系統"
Cmd_save.Enabled = False
Cmd_add.Enabled = True
Else
End If
Else
MsgBox "對不起,該信息已經保存過,不能夠再進行保存", 64, "采購管理系統"
End If
End If
Adodc1.RecordSource = "select * from Table_cgdd order by 單號"
Adodc1.Refresh
adoCon.Close
End Sub
Private Sub Combo1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
' If Not IsNumeric(Combo1.Text) Then
' MsgBox "輸入必須為數值型數據"
' Else
' End If
DT1.SetFocus
Else
End If
End Sub
Private Sub Combo2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text7.SetFocus
Else
End If
End Sub
Private Sub Combo3_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text5.SetFocus
Else
End If
End Sub
Private Sub DataGrid1_DblClick()
frm_ylhwdd.Show
frm_ylhwdd.Adodc1.RecordSource = "select * from Table_cgdd where 單號='" + txt_dh + "'"
frm_ylhwdd.Adodc1.Refresh
End Sub
Private Sub DT1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
DT2.SetFocus
Else
End If
End Sub
Private Sub DT2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Combo3.SetFocus
Else
End If
End Sub
Private Sub Form_Load()
Me.Left = (Screen.Width - Me.Width) / 2
Me.Top = (Screen.Height - Me.Height) / 2
DT1.Value = Date
DT2.Value = Date
frm_main.StatusBar1.Panels(1).Text = " 當前操作: " & Me.Caption
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
If Not IsNumeric(Text1.Text) Then
MsgBox "輸入的采購員編號必須為數字"
Else
Adodc1.RecordSource = "select * from Table_cgdd where 單號='" + Text1.Text + "'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Cmd_del.Enabled = True
Cmd_save.Enabled = True
Cmd_edit.Enabled = True
Text1.Text = Adodc1.Recordset.Fields("單號")
Text2.Text = Adodc1.Recordset.Fields("貨物名稱")
Text3.Text = Adodc1.Recordset.Fields("批號")
Text5.Text = Adodc1.Recordset.Fields("單價")
Text6.Text = Adodc1.Recordset.Fields("數量")
Text7.Text = Adodc1.Recordset.Fields("備注")
Text8.Text = Adodc1.Recordset.Fields("金額")
DT1.Value = Adodc1.Recordset.Fields("收貨日期")
DT2.Value = Adodc1.Recordset.Fields("發單時間")
Combo1.Text = Adodc1.Recordset.Fields("供應商編號")
Combo2.Text = Adodc1.Recordset.Fields("幣種")
Combo3.Text = Adodc1.Recordset.Fields("單位")
Else
MsgBox "沒有該采購員的信息!!", 64, "采購管理系統"
End If
End If
Else
End If
End Sub
Private Sub Text10_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
DT1.SetFocus
Else
End If
End Sub
Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
frm_cgclgl_temp.Show
frm_cgclgl_temp.DataGrid1.SetFocus
Else
End If
End Sub
Private Sub Text3_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Combo1.SetFocus
Else
End If
End Sub
Private Sub Text4_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text7.SetFocus
Else
End If
End Sub
Private Sub Text5_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
If Not IsNumeric(Text5.Text) Then
MsgBox "輸入的數量信息必須為數值型數據"
Text5.Text = ""
Text5.SetFocus
Else
Text6.SetFocus
End If
Else
End If
End Sub
Private Sub Text6_Change()
Text8.Text = Val(Text5.Text) * Val(Text6.Text)
End Sub
Private Sub Text6_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Combo2.SetFocus
Else
End If
End Sub
Private Sub Text6_LostFocus()
If Not IsNumeric(Text6.Text) Then
MsgBox "輸入的數量信息必須為數值型數據"
Text6.Text = ""
Text6.SetFocus
Else
End If
End Sub
Private Sub Text7_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Call Cmd_save_Click
Else
End If
End Sub
Private Sub Text8_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text5.SetFocus
Else
End If
End Sub
Private Sub Text9_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
frm_cgyxx_temp.Show
frm_cgyxx_temp.DataGrid1.SetFocus
Else
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
frm_main.StatusBar1.Panels(1).Text = " 吉林省明日科技有限公司"
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -