?? form_qtyggz.frm
字號:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form Form_qtyggz
Caption = "其他員工工資"
ClientHeight = 4515
ClientLeft = 60
ClientTop = 450
ClientWidth = 9660
LinkTopic = "Form1"
MDIChild = -1 'True
ScaleHeight = 4515
ScaleWidth = 9660
Begin VB.Frame Frame1
Height = 3615
Left = 120
TabIndex = 1
Top = 120
Width = 2895
Begin VB.CommandButton Command1
Caption = "輸入"
Height = 375
Left = 120
TabIndex = 12
Top = 1920
Width = 855
End
Begin VB.CommandButton Command2
Caption = "刪除"
Height = 375
Left = 1440
TabIndex = 11
Top = 1920
Width = 975
End
Begin VB.ComboBox Combo_zym
Height = 315
Left = 1320
TabIndex = 4
Top = 720
Width = 1335
End
Begin VB.TextBox Text_gz
Height = 375
Left = 1320
TabIndex = 3
Top = 1200
Width = 1335
End
Begin VB.TextBox Text_month
Height = 270
Left = 1920
TabIndex = 2
Text = "Text2"
Top = 240
Width = 495
End
Begin VB.Label label1
Caption = "選擇職員名"
Height = 255
Left = 120
TabIndex = 10
Top = 720
Width = 1095
End
Begin VB.Label Label2
Caption = "輸入月份"
Height = 255
Left = 120
TabIndex = 9
Top = 240
Width = 735
End
Begin VB.Label Label3
Caption = "Label3"
Height = 255
Left = 1200
TabIndex = 8
Top = 240
Width = 495
End
Begin VB.Label Label4
Caption = "輸入工資"
Height = 255
Left = 120
TabIndex = 7
Top = 1320
Width = 855
End
Begin VB.Label Label5
Caption = "年"
Height = 255
Left = 1680
TabIndex = 6
Top = 240
Width = 255
End
Begin VB.Label Label6
Caption = "月"
Height = 255
Left = 2520
TabIndex = 5
Top = 240
Width = 255
End
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 3600
Top = 3960
Visible = 0 'False
Width = 1200
_ExtentX = 2117
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=.\database.mdb;Persist Security Info=False"
OLEDBString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=.\database.mdb;Persist Security Info=False"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = $"Form_qtyggz.frx":0000
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
Begin MSAdodcLib.Adodc Adodc2
Height = 375
Left = 600
Top = 2760
Visible = 0 'False
Width = 1200
_ExtentX = 2117
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=.\database.mdb;Persist Security Info=False"
OLEDBString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=.\database.mdb;Persist Security Info=False"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = $"Form_qtyggz.frx":006D
Caption = "Adodc2"
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
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "Form_qtyggz.frx":00E7
Height = 3615
Left = 3120
TabIndex = 0
Top = 120
Width = 5775
_ExtentX = 10186
_ExtentY = 6376
_Version = 393216
HeadLines = 1
RowHeight = 15
FormatLocked = -1 'True
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 3
BeginProperty Column00
DataField = "職員名"
Caption = "職員名"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = "月份"
Caption = "月份"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column02
DataField = "工資"
Caption = "工資"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
ColumnWidth = 1800
EndProperty
BeginProperty Column01
ColumnWidth = 1335.118
EndProperty
BeginProperty Column02
ColumnWidth = 1094.74
EndProperty
EndProperty
End
End
Attribute VB_Name = "Form_qtyggz"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim zyh As String
Dim zy() As String
Private Sub Combo_zym_Click()
zyh = zy(1, Combo_zym.ListIndex + 1)
End Sub
Private Sub Command1_Click()
Dim sql, strfind, stryf, strmon As String 'sql語句,搜索語句,月份
If Combo_zym.text <> "" And Text_gz.text <> "" Then
If Val(Text_month.text) < 10 Then
strmon = "0" + Text_month.text
Else
strmon = Text_month.text
End If
stryf = Str(Year(Date)) + "年" + strmon + "月"
strfind = "select count(*) as num from 其他工資表 where 職員號='" & zyh & "' and 月份='" & stryf & "'"
If execsql(strfind) = 0 Then
sql = "insert into 其他工資表 (職員號,月份,工資) values('" & zyh & "','" & Trim(stryf) & "'," & Text_gz.text & ")"
delsql (sql)
Else
MsgBox "該員工" + stryf + "工資已添加", vbInformation + vbOKOnly, "提示"
End If
Adodc1.Refresh
Else
MsgBox "請輸入對應(yīng)職員的工資", vbInformation + vbOKOnly, "提示"
End If
End Sub
Private Sub Command2_Click()
Dim sql As String
If Adodc1.Recordset.EOF = False Then
idkey = Adodc1.Recordset.Fields("idkey")
sql = "delete from 其他工資表 where idkey=" & idkey
delsql (sql)
Adodc1.Refresh
End If
End Sub
Private Sub Form_Load()
Dim zysl As Integer
Label3.Caption = Year(Date)
Text_month.text = Month(Date)
Adodc2.Refresh
zysl = Adodc2.Recordset.RecordCount
ReDim zy(3, zysl)
For I = 1 To zysl
zy(1, I) = Adodc2.Recordset.Fields("職員號")
zy(2, I) = Adodc2.Recordset.Fields("職員名")
Combo_zym.AddItem (zy(2, I))
Adodc2.Recordset.MoveNext
Next
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -