?? frm_cgdd.frm
字號:
BeginProperty Column13
ColumnWidth = 1140.095
EndProperty
EndProperty
End
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 5880
Top = 2280
Width = 1200
_ExtentX = 2117
_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;Password=ee;Persist Security Info=True;User ID=elaine;Data Source=mydb1"
OLEDBString = "Provider=MSDASQL.1;Password=ee;Persist Security Info=True;User ID=elaine;Data Source=mydb1"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from Table_cgdd"
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
End
Begin VB.Frame Frame1
Caption = "訂單基本信息"
Height = 3015
Left = 240
TabIndex = 0
Top = 240
Width = 12975
Begin VB.ComboBox Combo3
Height = 315
Left = 9000
TabIndex = 26
Text = "Combo3"
Top = 1080
Width = 3255
End
Begin VB.TextBox Text9
Height = 495
Left = 9000
TabIndex = 25
Text = "Text9"
Top = 360
Width = 3135
End
Begin VB.TextBox Text8
Height = 495
Left = 10080
TabIndex = 24
Text = "Text8"
Top = 1680
Width = 2415
End
Begin VB.TextBox Text7
Height = 495
Left = 7200
TabIndex = 22
Text = "Text7"
Top = 1800
Width = 1575
End
Begin VB.ComboBox Combo2
Height = 315
Left = 4800
TabIndex = 18
Text = "Combo2"
Top = 1080
Width = 1935
End
Begin VB.TextBox Text6
Height = 375
Left = 4800
TabIndex = 17
Text = "Text6"
Top = 2400
Width = 7815
End
Begin VB.TextBox Text5
Height = 375
Left = 4800
TabIndex = 16
Text = "Text5"
Top = 1800
Width = 975
End
Begin VB.TextBox Text4
Height = 375
Left = 4800
TabIndex = 15
Text = "Text4"
Top = 240
Width = 2535
End
Begin VB.ComboBox Combo1
Height = 315
Left = 1440
TabIndex = 10
Text = "Combo1"
Top = 2400
Width = 2175
End
Begin VB.TextBox Text3
Height = 375
Left = 1440
TabIndex = 9
Text = "Text3"
Top = 1680
Width = 2175
End
Begin VB.TextBox Text2
Height = 375
Left = 1440
TabIndex = 8
Text = "Text2"
Top = 960
Width = 2175
End
Begin VB.TextBox Text1
Height = 375
Left = 1440
TabIndex = 7
Text = "Text1"
Top = 360
Width = 2175
End
Begin VB.Label Label12
AutoSize = -1 'True
Caption = "金額"
Height = 195
Left = 9120
TabIndex = 23
Top = 1800
Width = 360
End
Begin VB.Label Label11
AutoSize = -1 'True
Caption = "數量"
Height = 195
Left = 6120
TabIndex = 21
Top = 1800
Width = 360
End
Begin VB.Label Label10
AutoSize = -1 'True
Caption = "發單"
Height = 195
Left = 7800
TabIndex = 20
Top = 1080
Width = 360
End
Begin VB.Label Label9
AutoSize = -1 'True
Caption = "批號"
Height = 195
Left = 7800
TabIndex = 19
Top = 360
Width = 360
End
Begin VB.Label Label8
AutoSize = -1 'True
Caption = "備注"
Height = 195
Left = 3960
TabIndex = 14
Top = 2400
Width = 360
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "單價"
Height = 195
Left = 3960
TabIndex = 13
Top = 1800
Width = 360
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "收貨日期"
Height = 195
Left = 3960
TabIndex = 12
Top = 1080
Width = 720
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "貨物名稱"
Height = 195
Left = 3960
TabIndex = 11
Top = 360
Width = 720
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "幣種"
Height = 195
Left = 360
TabIndex = 6
Top = 2400
Width = 360
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "單位"
Height = 195
Left = 360
TabIndex = 5
Top = 1680
Width = 360
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "供應商編號"
Height = 195
Left = 360
TabIndex = 4
Top = 960
Width = 900
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "單號"
Height = 195
Left = 360
TabIndex = 3
Top = 360
Width = 360
End
End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Cmd_add_Click() '增加采購訂單信息
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.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_del_Click() '刪除采購信息
Adodc1.RecordSource = "select * from Table_cgdd"
'Dim c
If Adodc1.Recordset.RecordCount > 0 Then
c = MsgBox("確認要刪除該信息嗎", 17, "采購管理系統")
If c = vbOK Then
Adodc1.Recordset.Delete
Else
End If
Else
c = MsgBox("數據庫中的信息為空,沒有可刪除的信息", 64, "采購管理系統")
End If
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 &"","" _
)")
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -